Exemplo n.º 1
0
        private void OnChecked(object sender, RoutedEventArgs e)
        {
            CheckBox checkBox     = (CheckBox)e.OriginalSource;
            var      selectedItem = checkBox.DataContext as OrderedFood;

            Dg_ProcessingOrders.SelectedItem = selectedItem;

            foreach (var order in kitchenlist)
            {
                if (orderinKitchen.OrderId == order.OrderId)
                {
                    foreach (var food in order.OrderedFoods)
                    {
                        if (selectedItem.FoodId == food.FoodId && food.Quantity == selectedItem.Quantity)
                        {
                            if (selectedItem.ServedStatus)
                            {
                                food.ServedStatus = true;
                                var lst = order.OrderedFoods.Where(S => S.FoodId == food.FoodId)
                                          .Select(S => { S.ServedStatus = true; return(S); }).ToList();

                                TakeOrdersWindow.UpdateServedStatus(orderinKitchen.OrderId, food);
                            }
                            break;
                        }
                    }
                    break;
                }
            }

            Dg_ProcessingOrders.CommitEdit();
            Dg_ProcessingOrders.CommitEdit();
        }
Exemplo n.º 2
0
        public TakeOrdersWindow()
        {
            InitializeComponent();

            Instance = this;

            ordersInProcessingList = MyStorage.ReadXML <ObservableCollection <Order> >("ordersInProcessing.xml");

            if (ordersInProcessingList == null)
            {
                ordersInProcessingList = new ObservableCollection <Order>();
            }

            //extrafoods = new ObservableCollection<OrderedFood>();
        }
Exemplo n.º 3
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            categories          = MyStorage.GetEmbeddedXML <ObservableCollection <Category> >("Data.foods.xml");
            ordersCompletedList = MyStorage.ReadXML <ObservableCollection <Order> >("ordersCompleted.xml");

            if (ordersCompletedList == null)
            {
                ordersCompletedList = new ObservableCollection <Order>();
            }

            tables = new ObservableCollection <string> {
                "Table01", "Table02", "Table03", "Table04", "Table05"
            };

            TakeOrdersWindow takeOrdersWindow = new TakeOrdersWindow();

            takeOrdersWindow.Show();

            OrdersInKitchenWindow ordersInKitchenWindow = new OrdersInKitchenWindow();

            ordersInKitchenWindow.Show();
        }