public void CancelOrder(IStore store, IOrder order) { if (Orders.Exists(o => o.Store == order.Store && o.Number == order.Number)) { store.CancelOrder(order, this); } }
private static void Main(string[] args) { ICustomer alex = new Customer { Name = "Alex", Email = "*****@*****.**", Phone = "0712 121 212" }; IStore fordStore = CreateFordStore(); IStore skodaStore = CreateSkodaStore(); fordStore.Visit(alex); IOrder fordOrderForAlex = fordStore.OrderCar(alex, "Focus"); skodaStore.Visit(alex); IOrder skodaOrderForAlex = skodaStore.OrderCar(alex, "Fabia"); fordStore.CancelOrder(fordOrderForAlex.Nr); skodaStore.ReceiveOrder(skodaOrderForAlex.Nr); skodaStore.DeliverOrder(skodaOrderForAlex.Nr); }
private static void Main(string[] args) { ICustomer alex = new Customer { Name = "Alex", Email = "*****@*****.**", Phone = "0712 121 212" }; IStore fordStore = CreateFordStore(); IStore skodaStore = CreateSkodaStore(); fordStore.Visit(alex); IOrder fordOrderForAlex = fordStore.OrderCar(alex, "Focus", 28); fordStore.ConfirmOrder(1, 10); skodaStore.Visit(alex); IOrder skodaOrderForAlex = skodaStore.OrderCar(alex, "Fabia", 21); skodaStore.ConfirmOrder(2, 0); fordStore.CancelOrder(fordOrderForAlex.Nr); skodaStore.ReceiveOrder(skodaOrderForAlex.Nr); skodaStore.DeliverOrder(skodaOrderForAlex.Nr); IIssue iss1 = skodaStore.ReportProblem(2, $"front spoiler problem reported by {alex.Name}"); skodaStore.CheckProblem(iss1, 2); skodaStore.FixProblem(iss1); Console.ReadKey(); }