public void RefreshView() { Menu.Clear(); Clients.Clear(); ActiveOrders.Clear(); CompletedOrders.Clear(); ActiveDelivery.Clear(); CompletedDeliveries.Clear(); foreach (DishDTG dish in restaurantManager.GetMenu()) { Menu.Add(new DishModel(dish)); } foreach (ClientDTG client in restaurantManager.GetAllClients()) { Clients.Add(new ClientModel(client)); } foreach (OrderDTG order in restaurantManager.GetActiveOrders()) { ActiveOrders.Add(new OrderModel(order)); } foreach (OrderDTG order in restaurantManager.GetCompletedOrders()) { CompletedOrders.Add(new OrderModel(order)); } foreach (OrderDTG order in restaurantManager.GetActiveDeliveries()) { ActiveDelivery.Add(new OrderModel(order)); } foreach (OrderDTG order in restaurantManager.GetCompletedDeliveries()) { CompletedDeliveries.Add(new OrderModel(order)); } }
public void RefreshView() { Menu.Clear(); Clients.Clear(); ActiveOrders.Clear(); CompletedOrders.Clear(); ActiveDelivery.Clear(); CompletedDeliveries.Clear(); foreach (Dish dish in restaurantManager.GetMenu()) { Menu.Add(dish); } foreach (Client client in restaurantManager.GetAllClients()) { Clients.Add(client); } foreach (Order order in restaurantManager.GetActiveOrders()) { ActiveOrders.Add(order); } foreach (Order order in restaurantManager.GetCompletedOrders()) { CompletedOrders.Add(order); } foreach (Order order in restaurantManager.GetActiveDeliveries()) { ActiveDelivery.Add(order); } foreach (Order order in restaurantManager.GetCompletedDeliveries()) { CompletedDeliveries.Add(order); } }
public void TestAddClient() { restaurantManager.CreateClient("testName", "111222333", "Street", "1", "90-200"); List <ClientDTG> clients = restaurantManager.GetAllClients(); Assert.AreEqual(2, clients.Count, "Wrong clients number"); Assert.AreEqual("testName", clients[1].Name, "Wrong client name"); Assert.AreEqual("Street", clients[1].Adress.Street, "Wrong client street"); }