private Leg ToLeg(Voyage voyage, TransitEdge first, TransitEdge last)
 {
    return new Leg(voyage, _locatinRepository.Find(new UnLocode(first.From)), 
       first.FromDate,
       _locatinRepository.Find(new UnLocode(last.To)),
       last.ToDate);
 }
Exemple #2
0
 /// <summary>
 /// Creates new leg instance.
 /// </summary>
 /// <param name="voyage">Voyage</param>
 /// <param name="loadLocation">Location where cargo is supposed to be loaded.</param>
 /// <param name="loadDate">Date and time when cargo is supposed to be loaded</param>
 /// <param name="unloadLocation">Location where cargo is supposed to be unloaded.</param>
 /// <param name="unloadDate">Date and time when cargo is supposed to be unloaded.</param>
 public Leg(Voyage voyage, Location loadLocation, DateTime loadDate, Location unloadLocation, DateTime unloadDate)
 {
    _loadLocation = loadLocation;
    _voyage = voyage;
    _unloadDate = unloadDate;
    _unloadLocation = unloadLocation;
    _loadDate = loadDate;
 }
 private static TransitEdge ToEdge(Voyage voyage, CarrierMovement movement)
 {
    return new TransitEdge(voyage,
       movement.TransportLeg.DepartureLocation.UnLocode.CodeString,
       movement.TransportLeg.ArrivalLocation.UnLocode.CodeString,
       movement.DepartureTime,
       movement.ArrivalTime);
 }