static void Main(string[] args) { Account account = new Account("Learning Hard"); account.Deposit(1000.0); account.Deposit(200.0); account.Deposit(600.0); account.PayInterest(); account.Withdraw(2000.00); account.Withdraw(500.00); //订单 Order order = new Order(); order.Minute = 9; order.Action(); //可以取消订单 order.IsCancel = true; order.Minute = 20; order.Action(); order.Minute = 33; order.Action(); order.Minute = 43; order.Action(); Console.Read(); Console.ReadKey(); }
public void Process(Order order) { Console.WriteLine("订单开始受理!"); if (order.Minute < 30 && order.IsCancel) { Console.WriteLine("您有半个小时的时间可以取消订单!"); order.SetState(new CancelOrder()); order.Action(); } order.SetState(new AcceptAndDeliver()); order.TaskFinished = false; order.Action(); }
public void Process(Order order) { Console.WriteLine("我们开始受理,准备备货!"); if (order.Minute < 30 && order.IsCancel) { Console.WriteLine("接受半个小时之内,可以取消订单!"); order.SetState(new CancelOrder()); order.TaskFinished = true; order.Action(); } order.SetState(new AcceptAndDeliver()); order.TaskFinished = false; order.Action(); }
public void Process(Order order) { if (order.Minute < 30 && order.IsCancel) { Console.WriteLine("您有半个小时的时间可以取消订单!"); order.SetState(new CancelOrder()); order.Action(); } if (order.TaskFinished == false) { Console.WriteLine("我们货物已经准备好,可以发货了,不可以撤销订单!"); order.SetState(new ConfirmationReceipt()); order.Action(); } }
public void Process(Order order) { Console.WriteLine("订单结算"); order.SetState(new ConfirmationReceipt()); order.TaskFinished = true; order.Action(); }
public void Process(Order order) { Console.WriteLine("我们货物已经准备好,可以发货了,不可以撤销订单!"); if (order.Minute < 30 && order.IsCancel) { Console.WriteLine("接受半个小时之内,可以取消订单!"); order.SetState(new CancelOrder()); order.TaskFinished = true; order.Action(); } if (order.TaskFinished == false) { order.SetState(new Success()); order.Action(); } }
public void Process(Order order) { Console.WriteLine("检查货物,有问题,取消订单!"); order.SetState(new CancelOrder()); order.TaskFinished = true; order.Action(); }
public void Process(Order order) { Console.WriteLine("检查货物,没问题可以就可以签收!"); order.SetState(new Success()); order.TaskFinished = false; order.Action(); }
static void Main(string[] args) { Order order = new Order(); //可以取消订单 // order.IsCancel = true; order.Minute = 20; order.Action(); Console.WriteLine("Hello World!"); }