public override CargoState Recieve(Challenge00.DDDSample.Location.ILocation location, DateTime date) { if (null == location) { throw new ArgumentNullException("location"); } if (RoutingStatus.Routed != this.RoutingStatus) { string message = string.Empty; if (this.RoutingStatus == RoutingStatus.Misrouted) { message = string.Format("The cargo {0} is misrouted.", Identifier); } else { message = string.Format("The cargo {0} is not routed.", Identifier); } throw new InvalidOperationException(message); } if (!this.Itinerary.InitialDepartureLocation.Equals(location.UnLocode)) { string message = string.Format("Can not recieve cargo {0} at {1}. The planned route start from {2}.", Identifier, location.UnLocode, Itinerary.InitialDepartureLocation); throw new ArgumentException(message); } return(new InPortCargo(this, location.UnLocode, date)); }
public override CargoState ClearCustoms(Challenge00.DDDSample.Location.ILocation location, DateTime date) { string message = string.Format("Can not clear customs for the {0} cargo, since it's not yet recieved.", Identifier); throw new System.InvalidOperationException(message); }
public override CargoState Claim(Challenge00.DDDSample.Location.ILocation location, DateTime date) { throw new System.NotImplementedException(); }