Example #1
0
 public LegDTO ToDTO(Leg leg)
 {
    return new LegDTO("XXX",
                      leg.LoadLocation.UnLocode.CodeString,
                      leg.UnloadLocation.UnLocode.CodeString,
                      leg.LoadDate,
                      leg.UnloadDate);
 }
Example #2
0
 public LegDTO ToDTO(Leg leg)
 {
    return new LegDTO
              {
                 LoadLocation = leg.LoadLocation.UnLocode.CodeString,
                 UnloadLocation = leg.UnloadLocation.UnLocode.CodeString,
                 LoadDate = leg.LoadDate,
                 UnloadDate = leg.UnloadDate
              };            
 }
Example #3
0
 public LegDTO ToDTO(Leg leg)
 {
     return new LegDTO
     {
         From = leg.LoadLocation.UnLocode.CodeString,
         To = leg.UnloadLocation.UnLocode.CodeString,
         LoadTime = leg.LoadDate,
         UnloadTime = leg.UnloadDate,
         VoyageId = leg.Voyage.Id,
         VoyageNumber = leg.Voyage.Number.NumberString
     };
 }
Example #4
0
        private HandlingActivity CalculateNextExpectedActivity(RouteSpecification routeSpecification, Itinerary itinerary)
        {
            if (!OnTrack)
            {
                return(null);
            }

            if (LastEvent == null)
            {
                return(new HandlingActivity(HandlingEventType.Receive, routeSpecification.Origin));
            }

            switch (LastEvent.EventType)
            {
            case HandlingEventType.Load:

                Leg lastLeg = itinerary.Legs.FirstOrDefault(x => x.LoadLocation == LastEvent.Location);
                return(lastLeg != null ? new HandlingActivity(HandlingEventType.Unload, lastLeg.UnloadLocation) : null);

            case HandlingEventType.Unload:
                IEnumerator <Leg> enumerator = itinerary.Legs.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.UnloadLocation == LastEvent.Location)
                    {
                        Leg currentLeg = enumerator.Current;
                        return(enumerator.MoveNext() ? new HandlingActivity(HandlingEventType.Load, enumerator.Current.LoadLocation) : new HandlingActivity(HandlingEventType.Claim, currentLeg.UnloadLocation));
                    }
                }
                return(null);

            case HandlingEventType.Receive:
                Leg firstLeg = itinerary.Legs.First();
                return(new HandlingActivity(HandlingEventType.Load, firstLeg.LoadLocation));

            default:
                return(null);
            }
        }
 private LegDTO ToLegDTO(Leg x)
 {
     return _legDTOAssembler.ToDTO(x);
 }