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 API(RestaurantManager restaurantManager) { socketConnections = new List <SocketConnectionController>(); this.restaurantManager = restaurantManager; this.reportSender = new ReportSender(restaurantManager, 30000); Task.Run(() => reportSender.SendReport()); this.advertSender = new AdvertSender(restaurantManager, 10000); Task.Run(() => advertSender.SendReport()); }