コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public override CargoState Claim(Challenge00.DDDSample.Location.ILocation location, DateTime date)
 {
     throw new System.NotImplementedException();
 }