public void Ship()
 {
     Console.WriteLine("Shipping Product to your address....");
     _ecommerce.Stock = _ecommerce.Stock - 1;
     if (_ecommerce.Stock > 0)
     {
         _ecommerce.SetState(new SaleActive(_ecommerce));
     }
     else
     {
         _ecommerce.SetState(new OutOfStock());
     }
 }
Exemple #2
0
 public void PaymentDone()
 {
     Console.WriteLine("You made a payment. Payment was accepted");
     _ecommerce.SetState(new PurchaseInProcess(_ecommerce));
 }
 public void RefundPayment()
 {
     Console.WriteLine("Refunding your payment");
     _ecommerce.SetState(new SaleActive(_ecommerce));
 }