fix oeffisearch; add support for return tickets
This commit is contained in:
parent
e4ad77461a
commit
b443f2125b
|
@ -94,12 +94,12 @@ namespace bahnplan.web.JSON {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Posinfolist {
|
public class Posinfolist {
|
||||||
[J("posinfo", NullValueHandling = NV.Ignore)]
|
[J("posinfo", NullValueHandling = NV.Ignore), JsonConverter(typeof(SingleOrArrayConverter<PosinfoElement>))]
|
||||||
public PosinfoElement Posinfo { get; set; }
|
public List<PosinfoElement> Posinfo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FluffyChildlist {
|
public class FluffyChildlist {
|
||||||
[J("posinfo", NullValueHandling = NV.Ignore)]
|
[J("posinfo", NullValueHandling = NV.Ignore), JsonConverter(typeof(SingleOrArrayConverter<PosinfoElement>))]
|
||||||
public List<PosinfoElement> Posinfo { get; set; }
|
public List<PosinfoElement> Posinfo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,8 +136,8 @@ namespace bahnplan.web.JSON {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PurpleChildlist {
|
public class PurpleChildlist {
|
||||||
[J("posinfo", NullValueHandling = NV.Ignore)]
|
[J("posinfo", NullValueHandling = NV.Ignore), JsonConverter(typeof(SingleOrArrayConverter<PurplePosinfo>))]
|
||||||
public PurplePosinfo Posinfo { get; set; }
|
public List<PurplePosinfo> Posinfo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PosinfoElement {
|
public class PosinfoElement {
|
||||||
|
@ -231,10 +231,13 @@ namespace bahnplan.web.JSON {
|
||||||
|
|
||||||
public class Schedulelist {
|
public class Schedulelist {
|
||||||
[J("out", NullValueHandling = NV.Ignore)]
|
[J("out", NullValueHandling = NV.Ignore)]
|
||||||
public Out Out { get; set; }
|
public Journey Out { get; set; }
|
||||||
|
|
||||||
|
[J("ret", NullValueHandling = NV.Ignore)]
|
||||||
|
public Journey Ret { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Out {
|
public class Journey {
|
||||||
[J("txt", NullValueHandling = NV.Ignore)]
|
[J("txt", NullValueHandling = NV.Ignore)]
|
||||||
public string Txt { get; set; }
|
public string Txt { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace bahnplan.web.Pages {
|
||||||
? int.Parse(Request.Query["tripid"])
|
? int.Parse(Request.Query["tripid"])
|
||||||
: db.InsertWithInt32Identity(new Trip {UserId = int.Parse(HttpContext.Session.GetString("uid"))});
|
: db.InsertWithInt32Identity(new Trip {UserId = int.Parse(HttpContext.Session.GetString("uid"))});
|
||||||
|
|
||||||
foreach (var journey in parsed.Data.Journeys[jid].Legs) {
|
foreach (var journey in parsed.Data.Journeys[jid].Legs.Where(p => p.IsTransfer != true && p.IsWalking != true)) {
|
||||||
var arrtime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
var arrtime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
||||||
var deptime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
var deptime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
||||||
arrtime = arrtime.AddSeconds((long) journey.Arrival.PlannedTime).ToLocalTime();
|
arrtime = arrtime.AddSeconds((long) journey.Arrival.PlannedTime).ToLocalTime();
|
||||||
|
|
|
@ -105,6 +105,35 @@ namespace bahnplan.web.Pages {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parsed.Rporderdetails.Order.Schedulelist.Ret != null)
|
||||||
|
foreach (var leg in parsed.Rporderdetails.Order.Schedulelist.Ret.Trainlist.Train) {
|
||||||
|
db.InsertWithInt32Identity(new Leg {
|
||||||
|
TripId = tripId,
|
||||||
|
UserId = int.Parse(HttpContext.Session.GetString("uid")),
|
||||||
|
TrainType = leg.Gattung,
|
||||||
|
TrainNr = int.Parse(leg.Zugnummer),
|
||||||
|
ArrStation = leg.Arr.Name,
|
||||||
|
ArrStationId = int.Parse(leg.Arr.BhfNr),
|
||||||
|
ArrTime = leg.Arr.Date.Replace("00:00:00", leg.Arr.Time),
|
||||||
|
DepStation = leg.Dep.Name,
|
||||||
|
DepStationId = int.Parse(leg.Dep.BhfNr),
|
||||||
|
DepTime = leg.Dep.Date.Replace("00:00:00", leg.Dep.Time),
|
||||||
|
TicketId = ticketId
|
||||||
|
});
|
||||||
|
|
||||||
|
db.InsertWithInt32Identity(new TicketLeg {
|
||||||
|
TicketId = ticketId,
|
||||||
|
TrainType = leg.Gattung,
|
||||||
|
TrainNr = int.Parse(leg.Zugnummer),
|
||||||
|
ArrStation = leg.Arr.Name,
|
||||||
|
ArrStationId = int.Parse(leg.Arr.BhfNr),
|
||||||
|
ArrTime = leg.Arr.Date.Replace("00:00:00", leg.Arr.Time),
|
||||||
|
DepStation = leg.Dep.Name,
|
||||||
|
DepStationId = int.Parse(leg.Dep.BhfNr),
|
||||||
|
DepTime = leg.Dep.Date.Replace("00:00:00", leg.Dep.Time)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
TripId = tripId;
|
TripId = tripId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue