Beispiel #1
0
 public Registered(Order order)
     : base(order)
 {
 }
Beispiel #2
0
 public Granted(Order order)
     : base(order)
 {
 }
Beispiel #3
0
        public static void Run()
        {
            Product beer = new Product();
            beer.Name = "MyBestBeer";
            beer.Price = 78000;

            Order order = new Order();
            order.WriteCurrentStateName();

            order.AddProduct(beer);
            order.WriteCurrentStateName();

            order.Register();
            order.WriteCurrentStateName();

            order.Grant();
            order.WriteCurrentStateName();

            order.Ship();
            order.WriteCurrentStateName();

            //trying to add more beer to already shipped order
            order.AddProduct(beer);
            order.WriteCurrentStateName();

            //order.Invoice();
            //order.WriteCurrentStateName();
        }
Beispiel #4
0
 public Cancelled(Order order)
     : base(order)
 {
 }
Beispiel #5
0
 public OrderState(Order order)
 {
     _order = order;
 }
Beispiel #6
0
 public NewOrder(Order order)
     : base(order)
 {
 }
Beispiel #7
0
 public Invoiced(Order order)
     : base(order)
 {
 }
Beispiel #8
0
 public Shipped(Order order)
     : base(order)
 {
 }