public void MakeBarOrders() { KitchenBar_Service service = KitchenBar_Service.GetBarService(); List <KitchenBarOrder> orders = service.GetKitchenBarOrders(); tlp_OrderGrid.Controls.Clear(); foreach (KitchenBarOrder order in orders) { if (order.Orderstatus == "Besteld" || order.Orderstatus == "Wordt bereid") { List <Model.MenuItem> newitems = new List <Model.MenuItem>(); List <Model.MenuItem> items = order.OrderItems; foreach (Model.MenuItem item in items) { //Menutype 1 = drinks, Menutype 2 = Alcoholic drinks if (item.MenuTypeID == 1 || item.MenuTypeID == 2) { //add to list newitems.Add(item); } } if (newitems.Count != 0) { CustomOrderControl card = new CustomOrderControl(order.TableID, newitems, order.OrderID, order.OrderTime); tlp_OrderGrid.Controls.Add(card); card.Show(); newitems = null; } } } }
//replace with bar or kitchen private void CreateOrders() { KitchenBar_Service service = KitchenBar_Service.GetBarService(); List <KitchenBarOrder> orders = service.GetKitchenBarOrders(); for (int i = 0; i < orders.Count; i++) { CustomOrderControl card = new CustomOrderControl(orders[i].TableID, orders[i].OrderItems, orders[i].OrderID, orders[i].OrderTime); tlp_OrderGrid.Controls.Add(card); card.Show(); } }
private void btn_Annuleren_Click(object sender, EventArgs e) { if (lvOverzicht.FocusedItem == null) { MessageBox.Show("Selecteer eerst een tafel uit bovenstaande lijst.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { PendingOrder_Service pservice = new PendingOrder_Service(); List <PendingOrder> pendingorders = pservice.GetAllPendingOrders(); PendingOrder pendingOrder = pendingorders[lvOverzicht.FocusedItem.Index]; KitchenBar_Service service = KitchenBar_Service.GetBarService(); service.UpdatebarOrder(pendingOrder.OrderID, btn_Annuleren.Text); btn_refresh.PerformClick(); } }
private void btn_Confirm_Click(object sender, EventArgs e) { //Set this order to done KitchenBar_Service service = KitchenBar_Service.GetBarService(); service.UpdatebarOrder(OrderID, btn_Confirm.Text); if (this.MenuItems[0].MenuTypeID == 3 || this.MenuItems[0].MenuTypeID == 4) { KeukenBar kb = KeukenBar.GetKeukenBar(); kb.ReloadPage("Keuken"); } if (MenuItems[0].MenuTypeID == 1 || MenuItems[0].MenuTypeID == 2) { KeukenBar kb = KeukenBar.GetKeukenBar(); kb.ReloadPage("Bar"); } MessageBox.Show("Bestelling gereed gemeld.", "Gelukt!", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btn_Cancel_Click(object sender, EventArgs e) { //Set this order to cancelled KitchenBar_Service service = KitchenBar_Service.GetBarService(); service.UpdatebarOrder(OrderID, btn_Cancel.Text); if (MenuItems[0].MenuTypeID == 3 || MenuItems[0].MenuTypeID == 4) { KeukenBar kb = KeukenBar.GetKeukenBar(); kb.ReloadPage("Keuken"); } if (MenuItems[0].MenuTypeID == 1 || MenuItems[0].MenuTypeID == 2) { KeukenBar kb = KeukenBar.GetKeukenBar(); kb.ReloadPage("Bar"); } MessageBox.Show("Bestelling geannuleerd.", "Gelukt!", MessageBoxButtons.OK, MessageBoxIcon.Warning); }