public ViewControler() { restaurantManager = new RestaurantManager(); dishViewModel = new DishViewModel(restaurantManager); clientViewModel = new ClientViewModel(restaurantManager); restaurantManager.AddSampleData(); dishesNames = new List <string>(); Menu = new ObservableCollection <Dish>(); Card = new ObservableCollection <Dish>(); Clients = new ObservableCollection <Client>(); ActiveOrders = new ObservableCollection <Order>(); CompletedOrders = new ObservableCollection <Order>(); CurrentOrderDisplayDishes = new ObservableCollection <Dish>(); ActiveDelivery = new ObservableCollection <Order>(); CompletedDeliveries = new ObservableCollection <Order>(); CurrentDeliveryDisplayDishes = new ObservableCollection <Dish>(); reportSender = new ReportSender(restaurantManager, 15000); Task.Run(() => reportSender.SendReport()); reportReceiver = new ReportReceiver(startReportDate, endReportDate, reportIncome); reportReceiver.Subscribe(reportSender); addDish = new DelegateCommand(addDishToCard); clearCard = new DelegateCommand(Clear); addClient = new DelegateCommand(AddClient); createOrder = new DelegateCommand(CreateOrder); completeOrder = new DelegateCommand(CompleteOrder); completeDelivery = new DelegateCommand(CompleteDelivery); RefreshView(); }
public ViewControler() { restaurantManager = new RestaurantManager(51359); dishViewModel = new DishViewModel(restaurantManager); clientViewModel = new ClientViewModel(restaurantManager); //restaurantManager.AddSampleData(); dishesNames = new List <string>(); Menu = new ObservableCollection <DishModel>(); Card = new ObservableCollection <DishModel>(); Clients = new ObservableCollection <ClientModel>(); ActiveOrders = new ObservableCollection <OrderModel>(); CompletedOrders = new ObservableCollection <OrderModel>(); CurrentOrderDisplayDishes = new ObservableCollection <DishModel>(); ActiveDelivery = new ObservableCollection <OrderModel>(); CompletedDeliveries = new ObservableCollection <OrderModel>(); CurrentDeliveryDisplayDishes = new ObservableCollection <DishModel>(); reportReceiver = new ReportReceiver(); reportReceiver.Subscribe(restaurantManager.getReportSender()); addDish = new DelegateCommand(addDishToCard); clearCard = new DelegateCommand(Clear); addClient = new DelegateCommand(AddClient); createOrder = new DelegateCommand(CreateOrder); completeOrder = new DelegateCommand(CompleteOrder); completeDelivery = new DelegateCommand(CompleteDelivery); timer.Tick += (o, e) => { AdvertText = restaurantManager.api.AdvertText; }; timer.Start(); RefreshView(); }