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 TestAddDish() { restaurantManager.CreateDish("Chips", "testDishDescription", null, CategoryDTG.snack, 1.0); List <DishDTG> dishes = restaurantManager.GetMenu(); Assert.AreEqual(5, dishes.Count, "Wrong clients number"); Assert.AreEqual("Chips", dishes[4].Name, "Wrong dish name"); Assert.AreEqual(CategoryDTG.snack, dishes[4].Category, "Wrong dish category"); }