예제 #1
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, UnLocode location, DateTime registrationDate, DateTime completionDate)
 {
    _eventType = eventType;
    _completionDate = completionDate;
    _registrationDate = registrationDate;         
    _location = location;         
 }
예제 #2
0
        /// <summary>
        /// Registers new handling event into the history.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        /// <param name="location">Location where event occured.</param>
        /// <param name="registrationDate">Date when event was registered.</param>
        /// <param name="completionDate">Date when action represented by the event was completed.</param>
        public virtual void RegisterHandlingEvent(HandlingEventType eventType, Location location, DateTime registrationDate, DateTime completionDate)
        {
            HandlingEvent @event = new HandlingEvent(eventType, location, registrationDate, completionDate, this);

            _events.Add(@event);
            DomainEvents.Raise(new CargoWasHandledEvent(@event));
        }
예제 #3
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, DomainModel.Potential.Location.Location location, DateTime registrationDate, DateTime completionDate)
 {
    _eventType = eventType;         
    _completionDate = completionDate;
    _registrationDate = registrationDate;
    _location = location;
 }
예제 #4
0
        protected override void DoHandle(CargoHandledMessage message)
        {
            HandlingEventType lastKnownEvent    = (HandlingEventType)message.LastKnownEventType;
            HandlingEventType?nextExpectedEvent = null;

            if (message.NextExpectedEventType != null)
            {
                nextExpectedEvent = (HandlingEventType)message.NextExpectedEventType;
            }
            ReportingDataContext context = new ReportingDataContext();
            Cargo cargo = context.Cargos.First(x => x.TrackingId == message.TrackingId);

            cargo.UpdateHistory(
                nextExpectedEvent,
                message.NextExpectedLocation,
                lastKnownEvent,
                message.LastKnownLocation,
                (RoutingStatus)message.RoutingStatus,
                (TransportStatus)message.TransportStatus,
                message.EstimatedTimeOfArrival,
                message.IsUnloaded,
                message.IsMisdirected,
                message.CalculatedAt);

            context.SubmitChanges();
        }
예제 #5
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, UnLocode location, DateTime registrationDate, DateTime completionDate)
 {
     EventType        = eventType;
     CompletionDate   = completionDate;
     RegistrationDate = registrationDate;
     Location         = location;
 }
예제 #6
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate)
 {
     _eventType        = eventType;
     _completionDate   = completionDate;
     _registrationDate = registrationDate;
     _location         = location;
 }
예제 #7
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, DomainModel.Potential.Location.Location location, DateTime registrationDate, DateTime completionDate, HandlingHistory parent)
 {
     _eventType        = eventType;
     _parent           = parent;
     _completionDate   = completionDate;
     _registrationDate = registrationDate;
     _location         = location;
 }
예제 #8
0
		/// <summary>
		/// Creates an instance of <see cref="HandlingActivity"/> from the handling event type and the location.
		/// </summary>
		/// <param name="eventType">The handling event type.</param>
		/// <param name="location">The location where the handling is done.</param>
		public HandlingActivity(HandlingEventType eventType, Location.Location location)
		{
			if (location == null)
				throw new ArgumentNullException("location");

			_eventType = eventType;
			_location = location;
		}
예제 #9
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 /// <param name="cargo"></param>
 public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
 {
     EventType        = eventType;
     Location         = location;
     RegistrationDate = registrationDate;
     CompletionDate   = completionDate;
     Cargo            = cargo;
 }
예제 #10
0
  /// <summary>
  /// Creates new event.
  /// </summary>
  /// <param name="eventType"></param>
  /// <param name="location"></param>
  /// <param name="registrationDate"></param>
  /// <param name="completionDate"></param>
  /// <param name="cargo"></param>
  public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
 {
    EventType = eventType;
    Location = location;
    RegistrationDate = registrationDate;
    CompletionDate = completionDate;
    Cargo = cargo;
 }
 public void RegisterHandlingEvent(DateTime completionTime, string trackingId, string location, HandlingEventType type)
 {
    _handlingEventService.RegisterHandlingEvent(
       completionTime,
       new TrackingId(trackingId),            
       new UnLocode(location),
       type);
 }
예제 #12
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate, HandlingHistory parent)
 {
    _eventType = eventType;
    _parent = parent;
    _completionDate = completionDate;
    _registrationDate = registrationDate;         
    _location = location;         
 }
예제 #13
0
 /// <summary>
 /// Creates new event.
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="location"></param>
 /// <param name="registrationDate"></param>
 /// <param name="completionDate"></param>
 public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate, HandlingHistory parent)
 {
     EventType        = eventType;
     HandlingHistory  = parent;
     CompletionDate   = completionDate;
     RegistrationDate = registrationDate;
     Location         = location;
 }
예제 #14
0
 public HandlingActivity(HandlingEventType eventType, UnLocode location)
 {
    if (location == null)
    {
       throw new ArgumentNullException("location");
    }
    EventType = eventType;
    Location = location;
 }
예제 #15
0
 public HandlingActivity(HandlingEventType eventType, DomainModel.Potential.Location.Location location)
 {
    if (location == null)
    {
       throw new ArgumentNullException("location");
    }
    _eventType = eventType;
    _location = location;
 }
 public HandlingActivity(HandlingEventType eventType, DomainModel.Potential.Location.Location location)
 {
    if (location == null)
    {
       throw new ArgumentNullException("location");
    }
    _eventType = eventType;
    _location = location;
 }
예제 #17
0
 public HandlingActivity(HandlingEventType eventType, UnLocode location)
 {
     if (location == null)
     {
         throw new ArgumentNullException("location");
     }
     EventType = eventType;
     Location  = location;
 }
예제 #18
0
        /// <summary>
        /// Registers new handling event into the history.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        /// <param name="location">Location where event occured.</param>
        /// <param name="registrationDate">Date when event was registered.</param>
        /// <param name="completionDate">Date when action represented by the event was completed.</param>
        public virtual void RegisterHandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate)
        {
            HandlingEvent @event = new HandlingEvent(eventType, location, registrationDate, completionDate, this);

            _handlingEvents.Add(@event);
            _lastHandlingEvent = @event;
            Delivery currentDelivery = Delivery.DerivedFrom(_routeSpecification, _itinerary, @event);

            DomainEvents.Raise(new CargoWasHandledEvent(this, currentDelivery, eventType));
        }
예제 #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HandlingActivity"/> class.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        /// <param name="location">The location.</param>
        public HandlingActivity(HandlingEventType eventType, Location.Location location)
        {
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }

            m_eventType = eventType;
            m_location  = location;
        }
예제 #20
0
		/// <summary>
		/// Creates an instance of <see cref="HandlingActivity"/> from the handling event type and the location.
		/// </summary>
		/// <param name="eventType">The handling event type.</param>
		/// <param name="location">The location where the handling is done.</param>
		/// <param name="voyage"></param>
		public HandlingActivity(HandlingEventType eventType, Location.Location location, Voyage.Voyage voyage)
		{
			if (location == null)
				throw new ArgumentNullException("location");
			if (voyage == null)
				throw new ArgumentNullException("voyage");

			_eventType = eventType;
			_location = location;
			_voyage = voyage;
		}
예제 #21
0
 public void RegisterHandlingEvent(DateTime completionTime, string trackingId, string location, HandlingEventType type)
 {
     var command = new RegisterHandlingEventCommand
                       {
                           CompletionTime = completionTime,
                           TrackingId = trackingId,
                           OccuranceLocation = location,
                           Type = type
                       };
     _pipelineFactory.Process(command);
 }
예제 #22
0
        /// <summary>
        /// Creates new event.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="location"></param>
        /// <param name="registrationDate"></param>
        /// <param name="completionDate"></param>
        /// <param name="cargo"></param>
        public HandlingEvent(HandlingEventType eventType, Location.Location location,
                             DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
        {
            EventType        = eventType;
            Location         = location;
            RegistrationDate = registrationDate;
            CompletionDate   = completionDate;
            Cargo            = cargo;

            DomainEvents.Raise(new CargoWasHandledEvent(this));
        }
        /// <summary>
        /// Creates new event.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="location"></param>
        /// <param name="registrationDate"></param>
        /// <param name="completionDate"></param>
        /// <param name="cargo"></param>
        public HandlingEvent(HandlingEventType eventType, Location.Location location,
                             DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
        {
            EventType        = eventType;
            Location         = location;
            RegistrationDate = registrationDate;
            CompletionDate   = completionDate;
            Cargo            = cargo;

            m_eventAggregator.Publish <CargoWasHandledEvent>(new CargoWasHandledEvent());
        }
        /// <summary>
        /// Creates new event.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="location"></param>
        /// <param name="registrationDate"></param>
        /// <param name="completionDate"></param>
        /// <param name="cargo"></param>
        public HandlingEvent(HandlingEventType eventType, Location.Location location,
           DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
        {
            EventType = eventType;
            Location = location;
            RegistrationDate = registrationDate;
            CompletionDate = completionDate;
            Cargo = cargo;

            m_eventAggregator.Publish<CargoWasHandledEvent>(new CargoWasHandledEvent());
        }
예제 #25
0
 public Delivery(Cargo parent, HandlingEventType? nextExpectedEvent, string nextExpectedLocation, HandlingEventType? lastKnownEvent, string lastKnownLocation, RoutingStatus routingStatus, TransportStatus transportStatus, DateTime? estimatedTimeOfArrival, bool isUnloadedAtDestination, bool isMisdirected, DateTime calculatedAt)
    : this()
 {
    Id = Guid.NewGuid();
    Cargo = parent;
    NextExpectedEventType = nextExpectedEvent;
    NextExpectedLocation = nextExpectedLocation;
    LastKnownEventType = lastKnownEvent;
    LastKnownLocation = lastKnownLocation;
    RoutingStatus = routingStatus;
    TransportStatus = transportStatus;
    Eta = estimatedTimeOfArrival;
    UnloadedAtDest = isUnloadedAtDestination;
    IsMisdirected = isMisdirected;
    CalculatedAt = calculatedAt;
 }      
예제 #26
0
		/// <summary>
		/// Creates new event.
		/// </summary>
		/// <param name="eventType">Type of the event.</param>
		/// <param name="location">The location where the event took place.</param>
		/// <param name="registrationDate">Registration time, the time the message is received.</param>
		/// <param name="completionDate">Completion time, the reported time that the event actually happened (e.g. the receive took place).</param>
		/// <param name="cargo">Cargo.</param>
		public HandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate, Cargo.Cargo cargo)
		{
			if (cargo == null)
				throw new ArgumentNullException("cargo", "Cargo is required.");
			if (location == null)
				throw new ArgumentNullException("location", "Location is required.");
			if (registrationDate == default(DateTime))
				throw new ArgumentException("The registration date is required.", "registrationDate");
			if (completionDate == default(DateTime))
				throw new ArgumentException("The completion date is required.", "completionDate");

			if (eventType.RequiresVoyage())
				throw new ArgumentException("Voyage is required for event type event type : " + eventType, "eventType");

			_eventType = eventType;
			_completionDate = completionDate;
			_registrationDate = registrationDate;
			_location = location;
			_cargo = cargo;
			_voyage = null;
		}
예제 #27
0
 public ActionResult RegisterHandlingEvent(string trackingId, DateTime? completionTime, string location, HandlingEventType type)
 {
    bool validationError = false;
    if (!completionTime.HasValue)
    {
       ViewData.ModelState.AddModelError("completionTime", "Event completion date is required and must be a valid date.");
       validationError = true;            
    }         
    if (string.IsNullOrEmpty(trackingId))
    {
       ViewData.ModelState.AddModelError("trackingId", "Tracking id must be specified.");
       validationError = true;
    }         
    if (validationError)
    {
       AddHandlingLocations();
       AddHandlingEventTypes();
       return View();
    }
    _handlingEventFacade.RegisterHandlingEvent(completionTime.Value, trackingId, location, type );
    return RedirectToAction("Track", "Tracking", new {trackingId});
 }
예제 #28
0
 public CargoWasHandledEvent(Cargo cargo, Delivery delivery, HandlingEventType eventType)
 {
    _cargo = cargo;
    _eventType = eventType;
    _delivery = delivery;
 }
        public void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode unLocode, HandlingEventType type)
        {
            Cargo    cargo    = _cargoRepository.Find(trackingId);
            Location location = _locationRepository.Find(unLocode);

            cargo.RegisterHandlingEvent(type, location, DateTime.Now, completionTime);
        }
예제 #30
0
 /// <summary>
 /// Registers new handling event into the history.
 /// </summary>
 /// <param name="eventType">Type of the event.</param>
 /// <param name="location">Location where event occured.</param>
 /// <param name="registrationDate">Date when event was registered.</param>
 /// <param name="completionDate">Date when action represented by the event was completed.</param>
 public virtual void RegisterHandlingEvent(HandlingEventType eventType, UnLocode location, DateTime registrationDate, DateTime completionDate)
 {
    var @event = new HandlingEvent(eventType, location, registrationDate, completionDate);
    
    Publish(this, new CargoHandledEvent(Delivery.DerivedFrom(RouteSpecification, Itinerary, @event)));
 }      
예제 #31
0
        public void RegisterHandlingEvent(DateTime completionTime, string trackingId, string location, HandlingEventType type)
        {
            var command = new RegisterHandlingEventCommand
            {
                CompletionTime    = completionTime,
                TrackingId        = trackingId,
                OccuranceLocation = location,
                Type = type
            };

            _pipelineFactory.Process(command);
        }
예제 #32
0
 /// <summary>
 /// Registers new handling event into the history.
 /// </summary>
 /// <param name="eventType">Type of the event.</param>
 /// <param name="location">Location where event occured.</param>
 /// <param name="registrationDate">Date when event was registered.</param>
 /// <param name="completionDate">Date when action represented by the event was completed.</param>
 public virtual void RegisterHandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate)
 {
    HandlingEvent @event = new HandlingEvent(eventType, location, registrationDate, completionDate, this);
    _handlingEvents.Add(@event);
    _lastHandlingEvent = @event;
    Delivery currentDelivery = Delivery.DerivedFrom(_routeSpecification, _itinerary, @event);         
    DomainEvents.Raise(new CargoWasHandledEvent(this, currentDelivery, eventType));
 }
예제 #33
0
 public static ItineraryTestHelper IsNotExpectedToBe(this Itinerary itinerary, HandlingEventType eventType)
 {
     return new ItineraryTestHelper(false, eventType, itinerary);
 }
예제 #34
0
 partial void OnNextExpectedEventTypeChanging(HandlingEventType? value);
 public HandlingActivity(HandlingEventType eventType, string location)
 {
     EventType = eventType;
     Location  = location;
 }
 public void should_handle_specific_event_types_to_require_carrier_movement_association(HandlingEventType handlingEventType)
 {
     Assert.Throws<ArgumentException>(delegate
                                         {
                                             new HandlingEvent(handlingEventType, _hongkong, DateTime.Now, DateTime.Now, _cargo);
                                         }
                                     );
 }
예제 #37
0
 public HandlingActivity(HandlingEventType eventType, string location)
 {
    EventType = eventType;
    Location = location;
 }
예제 #38
0
 private static HandlingEvent Event(HandlingEventType eventType, Location.Location location)
 {
     return new HandlingEvent(eventType, location, DateTime.Now, DateTime.Now, null);
 }
        public ActionResult RegisterHandlingEvent(string trackingId, DateTime?completionTime, string location, HandlingEventType type)
        {
            bool validationError = false;

            if (!completionTime.HasValue)
            {
                ViewData.ModelState.AddModelError("completionTime", "Event completion date is required and must be a valid date.");
                validationError = true;
            }
            if (string.IsNullOrEmpty(trackingId))
            {
                ViewData.ModelState.AddModelError("trackingId", "Tracking id must be specified.");
                validationError = true;
            }
            if (validationError)
            {
                AddHandlingLocations();
                AddHandlingEventTypes();
                return(View());
            }
            _handlingEventFacade.RegisterHandlingEvent(completionTime.Value, trackingId, location, type);
            return(RedirectToAction("Index", "Home"));
        }
 private static void RegisterHandlingEvent(Guid cargoId, DateTime time, UnLocode location, HandlingEventType eventType)
 {
     InvokeCommand(new RegisterHandlingEventCommand
     {
         CargoId        = cargoId,
         CompletionTime = time,
         Location       = location.CodeString,
         Type           = eventType
     });
 }
        private static void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode occuranceLocation, HandlingEventType handlingEventType)
        {
            var registerHandlingEventCommand = new RegisterHandlingEventCommand()
            {
                CompletionTime    = completionTime,
                OccuranceLocation = occuranceLocation.CodeString,
                TrackingId        = trackingId.IdString,
                Type = handlingEventType
            };

            CommandPipeline.Process(registerHandlingEventCommand);
        }
예제 #42
0
 public ItineraryTestHelper(bool expected, HandlingEventType eventType, Itinerary itinerary)
 {
     _expected = expected;
     _itinerary = itinerary;
     _eventType = eventType;
 }
 /// <summary>
 /// Checks if this <see cref="HandlingEventType"/> requires specyfying a <see cref="DDDSample.Domain.Voyage.Voyage"/>
 /// object when constructing new <see cref="HandlingEvent"/>.
 /// </summary>
 /// <param name="eventType">Event type value.</param>
 /// <returns>True, if requires.</returns>
 public static bool RequiresVoyage(this HandlingEventType eventType)
 {
     return(eventType == HandlingEventType.Load || eventType == HandlingEventType.Unload);
 }
예제 #44
0
 partial void OnLastKnownEventTypeChanging(HandlingEventType? value);
예제 #45
0
        /// <summary>
        /// Registers new handling event into the history.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        /// <param name="location">Location where event occured.</param>
        /// <param name="registrationDate">Date when event was registered.</param>
        /// <param name="completionDate">Date when action represented by the event was completed.</param>
        public virtual void RegisterHandlingEvent(HandlingEventType eventType, UnLocode location, DateTime registrationDate, DateTime completionDate)
        {
            HandlingEvent @event = new HandlingEvent(eventType, location, registrationDate, completionDate);

            Publish(this, new CargoHandledEvent(Delivery.DerivedFrom(_routeSpecification, _itinerary, @event)));
        }
 public CargoWasHandledEvent(Cargo cargo, Delivery delivery, HandlingEventType eventType)
 {
     _cargo     = cargo;
     _eventType = eventType;
     _delivery  = delivery;
 }
예제 #47
0
 public static ItineraryTestHelper IsNotExpectedToBe(this Itinerary itinerary, HandlingEventType eventType)
 {
     return(new ItineraryTestHelper(false, eventType, itinerary));
 }
 private static void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode occuranceLocation, HandlingEventType handlingEventType)
 {
     var registerHandlingEventCommand = new RegisterHandlingEventCommand()
                                            {
                                                CompletionTime = completionTime,
                                                OccuranceLocation = occuranceLocation.CodeString,
                                                TrackingId = trackingId.IdString,
                                                Type = handlingEventType
                                            };
     CommandPipeline.Process(registerHandlingEventCommand);
 }
예제 #49
0
 private static HandlingEvent Event(HandlingEventType eventType, Location.Location location)
 {
     return(new HandlingEvent(eventType, location, DateTime.Now, DateTime.Now, null));
 }
        public void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode unLocode, HandlingEventType type)
        {
            HandlingHistory handlingHistory = _handlingEventRepository.LookupHandlingHistoryOfCargo(trackingId);
            Location        location        = _locationRepository.Find(unLocode);

            handlingHistory.RegisterHandlingEvent(type, location, DateTime.Now, completionTime);
        }
예제 #51
0
 public virtual void UpdateHistory(HandlingEventType? nextExpectedEvent, string nextExpectedLocation, HandlingEventType? lastKnownEvent, string lastKnownLocation, RoutingStatus routingStatus, TransportStatus transportStatus, DateTime? estimatedTimeOfArrival, bool isUnloadedAtDestination, bool isMisdirected, DateTime calculatedAt)
 {
    Delivery delivery = new Delivery(this, nextExpectedEvent, nextExpectedLocation, lastKnownEvent, lastKnownLocation, routingStatus, transportStatus, estimatedTimeOfArrival, isUnloadedAtDestination, isMisdirected, calculatedAt);
    DeliveryHistory.Add(delivery);
    CurrentInformation = delivery;
 }
 /// <summary>
 /// Checks if this <see cref="HandlingEventType"/> prohibits specyfying a <see cref="DDDSample.Domain.Voyage.Voyage"/>
 /// object when constructing new <see cref="HandlingEvent"/>.
 /// </summary>
 /// <param name="eventType">Event type value.</param>
 /// <returns>True, if prohibits.</returns>
 public static bool ProhibitsVoyage(this HandlingEventType eventType)
 {
     return(!RequiresVoyage(eventType));
 }
예제 #53
0
 /// <summary>
 /// Registers new handling event into the history.
 /// </summary>
 /// <param name="eventType">Type of the event.</param>
 /// <param name="location">Location where event occured.</param>
 /// <param name="registrationDate">Date when event was registered.</param>
 /// <param name="completionDate">Date when action represented by the event was completed.</param>
 public virtual void RegisterHandlingEvent(HandlingEventType eventType, Location.Location location, DateTime registrationDate, DateTime completionDate)
 {         
    HandlingEvent @event = new HandlingEvent(eventType, location, registrationDate, completionDate,this);
    _events.Add(@event);
    DomainEvents.Raise(new CargoWasHandledEvent(@event));
 }
 private static void RegisterHandlingEvent(string cargoId, DateTime time, UnLocode location, HandlingEventType eventType)
 {
    InvokeCommand(new RegisterHandlingEventCommand
                     {
                        CargoId = cargoId,
                        CompletionTime = time,
                        Location = location.CodeString,
                        Type = eventType
                     });
 }
예제 #55
0
 public void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode unLocode, HandlingEventType type)
 {
    HandlingHistory handlingHistory = _handlingEventRepository.LookupHandlingHistoryOfCargo(trackingId);
    Location location = _locationRepository.Find(unLocode);
    handlingHistory.RegisterHandlingEvent(type, location, DateTime.Now, completionTime);         
 }
예제 #56
0
 public ItineraryTestHelper(bool expected, HandlingEventType eventType, Itinerary itinerary)
 {
     _expected  = expected;
     _itinerary = itinerary;
     _eventType = eventType;
 }
예제 #57
0
 public void RegisterHandlingEvent(DateTime completionTime, string trackingId, string location, HandlingEventType type)
 {
     _handlingEventService.RegisterHandlingEvent(
         completionTime,
         new TrackingId(trackingId),
         new UnLocode(location),
         type);
 }
예제 #58
0
 public void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode unLocode, HandlingEventType type)
 {
    Cargo cargo = _cargoRepository.Find(trackingId);                  
    Location location = _locationRepository.Find(unLocode);
    cargo.RegisterHandlingEvent(type, location, DateTime.Now, completionTime);
 }
        public void RegisterHandlingEvent(DateTime completionTime, TrackingId trackingId, UnLocode unLocode, HandlingEventType type)
        {
            var cargo    = _cargoRepository.Find(trackingId);
            var location = _locationRepository.Find(unLocode);
            var @event   = new HandlingEvent(type, location, DateTime.Now, completionTime, cargo);

            _handlingEventRepository.Store(@event);
        }