Esempio n. 1
0
 public virtual void Execute(IPropertyCommand <string, string> command)
 {
     if (null == command.GetState() && null == command.Content)
     {
         command.SetState("Drafted");
         return;
     }
     if ("Drafted" == command.GetState() && "Complete" == command.Content)
     {
         command.SetState("Completed");
         return;
     }
     if ("Drafted" == command.GetState() && "Void" == command.Content)
     {
         command.SetState("Voided");
         return;
     }
     if ("Completed" == command.GetState() && "Close" == command.Content)
     {
         command.SetState("Closed");
         return;
     }
     if ("Completed" == command.GetState() && "Reverse" == command.Content)
     {
         command.SetState("Reversed");
         return;
     }
     throw new ArgumentException(String.Format("State: {0}, command: {1}", command.GetState, command.Content));
 }
Esempio n. 2
0
 public virtual void Execute(IPropertyCommand <string, string> command)
 {
     if (null == command.GetState() && null == command.Content)
     {
         command.SetState("SHIP_GRP_CREATED");
         return;
     }
     if ("SHIP_GRP_CREATED" == command.GetState() && "Approve" == command.Content)
     {
         command.SetState("SHIP_GRP_APPROVED");
         return;
     }
     if ("SHIP_GRP_APPROVED" == command.GetState() && "Complete" == command.Content)
     {
         command.SetState("SHIP_GRP_COMPLETED");
         return;
     }
     if ("SHIP_GRP_CREATED" == command.GetState() && "Reject" == command.Content)
     {
         command.SetState("SHIP_GRP_REJECTED");
         return;
     }
     if ("SHIP_GRP_CREATED" == command.GetState() && "Cancel" == command.Content)
     {
         command.SetState("SHIP_GRP_CANCELLED");
         return;
     }
     throw new ArgumentException(String.Format("State: {0}, command: {1}", command.GetState, command.Content));
 }
Esempio n. 3
0
 public virtual void Execute(IPropertyCommand <string, string> command)
 {
     if (null == command.GetState() && null == command.Content)
     {
         command.SetState("Drafted");
         return;
     }
     if ("Drafted" == command.GetState() && "Void" == command.Content)
     {
         command.SetState("Voided");
         return;
     }
     if ("Drafted" == command.GetState() && "Complete" == command.Content && ((IMovementState)command.Context).IsInTransit == false)
     {
         command.SetState("Completed");
         return;
     }
     if ("Drafted" == command.GetState() && "Complete" == command.Content && ((IMovementState)command.Context).IsInTransit == true)
     {
         command.SetState("InProgress");
         return;
     }
     if ("InProgress" == command.GetState() && "Confirm" == command.Content)
     {
         command.SetState("Complete");
         return;
     }
     if ("Completed" == command.GetState() && "Close" == command.Content)
     {
         command.SetState("Closed");
         return;
     }
     if ("Completed" == command.GetState() && "Reverse" == command.Content && ((IMovementState)command.Context).IsInTransit == false)
     {
         command.SetState("Reversed");
         return;
     }
     throw new ArgumentException(String.Format("State: {0}, command: {1}", command.GetState, command.Content));
 }