Exemple #1
0
 public EF_StopTime(GTFS_StopTime stoptime, EF_Trip trip, EF_Stop stop)
 {
     TripId = trip;
     StopId = stop;
     try
     {
         ArrivalTime = TimeSpan.ParseExact(stoptime.ArrivalTime, @"hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     catch (System.OverflowException)
     {
         var values = stoptime.ArrivalTime.Split(':');
         values[0] = (Int32.Parse(values[0]) % 24).ToString();
         ArrivalTime = TimeSpan.ParseExact(values[0] + ':' + values[1] + ':' + values[2], @"h\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     try
     {
         DepartureTime = TimeSpan.ParseExact(stoptime.DepartureTime, @"hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     catch (System.OverflowException)
     {
         var values = stoptime.DepartureTime.Split(':');
         values[0] = (Int32.Parse(values[0]) % 24).ToString();
         DepartureTime = TimeSpan.ParseExact(values[0] + ':' + values[1] + ':' + values[2], @"h\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     StopSequence = stoptime.StopSequence;
     ShapeDistanceTraveled = stoptime.ShapeDistanceTraveled;
 }
Exemple #2
0
 public EF_StopTime(GTFS_StopTime stoptime, EF_Trip trip, EF_Stop stop)
 {
     TripId = trip;
     StopId = stop;
     try
     {
         ArrivalTime = TimeSpan.ParseExact(stoptime.ArrivalTime, @"hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     catch (System.OverflowException)
     {
         var values = stoptime.ArrivalTime.Split(':');
         values[0]   = (Int32.Parse(values[0]) % 24).ToString();
         ArrivalTime = TimeSpan.ParseExact(values[0] + ':' + values[1] + ':' + values[2], @"h\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     try
     {
         DepartureTime = TimeSpan.ParseExact(stoptime.DepartureTime, @"hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     catch (System.OverflowException)
     {
         var values = stoptime.DepartureTime.Split(':');
         values[0]     = (Int32.Parse(values[0]) % 24).ToString();
         DepartureTime = TimeSpan.ParseExact(values[0] + ':' + values[1] + ':' + values[2], @"h\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture);
     }
     StopSequence          = stoptime.StopSequence;
     ShapeDistanceTraveled = stoptime.ShapeDistanceTraveled;
 }