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(); } }