Bugfix
This commit is contained in:
parent
2554b89ed2
commit
7699064cfd
|
@ -46,6 +46,22 @@ namespace bahnplan.web.Pages {
|
||||||
db.Delete(db.Legs.Where(p => p.TripId == tripid).OrderBy(p => p.DepTime).First());
|
db.Delete(db.Legs.Where(p => p.TripId == tripid).OrderBy(p => p.DepTime).First());
|
||||||
else if (db.Legs.Where(p => p.TripId == tripid).OrderByDescending(p => p.DepTime).First().DepTime.EndsWith("placeholder"))
|
else if (db.Legs.Where(p => p.TripId == tripid).OrderByDescending(p => p.DepTime).First().DepTime.EndsWith("placeholder"))
|
||||||
db.Delete(db.Legs.Where(p => p.TripId == tripid).OrderByDescending(p => p.DepTime).First());
|
db.Delete(db.Legs.Where(p => p.TripId == tripid).OrderByDescending(p => p.DepTime).First());
|
||||||
|
|
||||||
|
var failsafe = false;
|
||||||
|
foreach (var failsafeleg in db.Legs.Where(p => p.TripId == tripid).OrderBy(p => p.DepTime).ToList()) {
|
||||||
|
if (failsafeleg.DepTime.EndsWith("placeholder")) {
|
||||||
|
if (failsafe == false) {
|
||||||
|
failsafe = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
db.Legs.Delete(p => p.LegId == failsafeleg.LegId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
failsafe = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "ticket": {
|
case "ticket": {
|
||||||
|
|
Reference in a new issue