Example #1
0
        void SetOrderStatus(int orderStatusID)
        {
            switch (orderStatusID)
            {
            case 1:
                CurrentState = new NewOrder(this);
                break;

            case 2:
                CurrentState = new Submitted(this);
                break;

            case 3:
                CurrentState = new Verified(this);
                break;

            case 4:
            case 5:
                CurrentState = new Charged(this);
                break;

            case 6:
                CurrentState = new Shipped(this);
                break;

            case 7:
                CurrentState = new Returned(this);
                break;

            case 8:
                CurrentState = new Cancelled(this);
                break;

            case 9:
                CurrentState = new Refunded(this);
                break;

            case 10:
                CurrentState = new Closed(this);
                break;
            }
        }
Example #2
0
 void SetOrderStatus(int orderStatusID)
 {
     switch (orderStatusID) {
         case 1:
             CurrentState = new NewOrder(this);
             break;
         case 2:
             CurrentState = new Submitted(this);
             break;
         case 3:
             CurrentState = new Verified(this);
             break;
         case 4:
         case 5:
             CurrentState = new Charged(this);
             break;
         case 6:
             CurrentState = new Shipped(this);
             break;
         case 7:
             CurrentState = new Returned(this);
             break;
         case 8:
             CurrentState = new Cancelled(this);
             break;
         case 9:
             CurrentState = new Refunded(this);
             break;
         case 10:
             CurrentState = new Closed(this);
             break;
     }
 }