Beispiel #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);
		}
Beispiel #2
0
		public override CargoState Claim (Challenge00.DDDSample.Location.ILocation location, DateTime date)
		{
			string message = string.Format("Can not claim the {0} cargo, since it's not yet recieved.", Identifier);
			throw new System.InvalidOperationException(message);
		}
Beispiel #3
0
		public override CargoState Unload (Challenge00.DDDSample.Voyage.IVoyage voyage, DateTime date)
		{
			throw new System.NotImplementedException();
		}
Beispiel #4
0
		public override CargoState Unload (Challenge00.DDDSample.Voyage.IVoyage voyage, DateTime date)
		{
			string message = string.Format("Can not unload the {0} cargo from the {1} voyage, since it's not yet recieved.", Identifier, voyage.Number);
			throw new System.InvalidOperationException(message);
		}
Beispiel #5
0
		public override CargoState Claim (Challenge00.DDDSample.Location.ILocation location, DateTime date)
		{
			throw new System.NotImplementedException();
		}