Esempio n. 1
0
 internal static Models.Data.TripPassage Convert(Models.API.TripPassage passage)
 {
     return(new Models.Data.TripPassage
     {
         ActualTime = passage.ActualTime != null?TimeSpan.ParseExact(passage.ActualTime, "g", System.Globalization.CultureInfo.InvariantCulture) : new TimeSpan(),
                          Status = PassageStatusConverter.Convert(passage.StatusString),
                          SeqNumber = passage.SequenceNo,
                          StopId = passage.Stop?.ID,
                          StopName = passage.Stop?.Name
     });
 }
Esempio n. 2
0
 internal static Passage Convert(StopPassage passage)
 {
     return(new Passage
     {
         ActualRelative = passage.ActualRelativeTime,
         ActualTime = passage.ActualTime != null?TimeSpan.ParseExact(passage.ActualTime, "g", System.Globalization.CultureInfo.InvariantCulture) : new TimeSpan(),
                          PlannedTime = TimeSpan.ParseExact(passage.PlannedTime, "g", System.Globalization.CultureInfo.InvariantCulture),
                          MixedTime = passage.MixedTime,
                          Direction = passage.Direction,
                          Line = passage.PatternText,
                          Status = PassageStatusConverter.Convert(passage.StatusString),
                          Vehicle = passage.GetVehicle()
     });
 }