private void btn_Taf10_Click(object sender, EventArgs e) { //Verberg alle andere panels pnl_StatusOverzicht.Hide(); pnl_TafelOverzicht.Hide(); pnl_OpenOrders.Hide(); pnl_BestellingOpnemen.Hide(); pnl_OrderBevestiging.Hide(); //Toon bestelling panel en verander tafel pnl_TafelNAV.Show(); lbl_StatusOverzicht.Text = "Tafel 10"; PopulateListview(); tafel_Service tafel_Status = new tafel_Service(); List <Tafel> tafels = tafel_Status.Get_Tafels(); foreach (Tafel tafel in tafels) { if (tafel.Tafel_Status == Tafel_Status.Bezet) { pnl_OpenOrders.Show(); } else { pnl_BestellingOpnemen.Show(); } } }
private void btn_Taf2_Click(object sender, EventArgs e) { //Verberg alle andere panels pnl_StatusOverzicht.Hide(); pnl_TafelOverzicht.Hide(); pnl_OpenOrders.Hide(); pnl_BestellingOpnemen.Hide(); pnl_OrderBevestiging.Hide(); //Toon bestelling panel en verander tafel pnl_TafelNAV.Show(); lbl_StatusOverzicht.Text = "Tafel 2"; tafel_Service tafel_Status = new tafel_Service(); List <Tafel> tafels = tafel_Status.Get_Tafels(); foreach (Tafel tafel in tafels) { if (btn_Taf2.BackColor == Color.FromArgb(25, 211, 118)) { pnl_OpenOrders.Show(); } else { pnl_BestellingOpnemen.Show(); PopulateListview(); } } }
private void btn_VoegToe_DEF_Click(object sender, EventArgs e) { lbl_Productnaam.Text = listView_MenuItems.SelectedItems[0].SubItems[1].Text; //Order Order_Service order_Service = new Order_Service(); List <Order> orders = new List <Order>(); //Order items Order_Items_Service order_Items_Service = new Order_Items_Service(); List <Order_Item> order_items = new List <Order_Item>(); //Werknemer Werknemer werknemer = new Werknemer(); werknemer.Werknemer_ID = 2; //Tafel info tafel_Service tafel_Service = new tafel_Service(); List <Tafel> tafels = tafel_Service.Get_Tafels(); //Order Items info Order_Item order_Item = new Order_Item(); foreach (Tafel tafel in tafels) { if (tafel.Tafel_Status == Tafel_Status.Open || tafel.Tafel_Status == Tafel_Status.Gereserveerd) { orders = order_Service.New_Order(tafel, werknemer); foreach (Order order in orders) { order_Item.Order_ID = order.Order_ID; } order_Item.Menu_Item_ID = int.Parse(listView_MenuItems.SelectedItems[0].SubItems[1].Text); order_Item.status = Order_Status.Besteld; order_Item.Hoeveelheid = int.Parse(txt_Hoeveelheid.Text); order_Item.Tijd = DateTime.Now; order_Item.Opmerking = txt_Opmerking.Text; } //else if (tafel.Tafel_Status == Tafel_Status.Bezet) //{ // orders = order_Service.Get_Orders(); // order_Item.Menu_Item_ID = int.Parse(listView_MenuItems.SelectedItems[0].SubItems[1].Text); // order_Item.status = Order_Status.Besteld; // order_Item.Hoeveelheid = int.Parse(txt_Hoeveelheid.Text); // order_Item.Tijd = DateTime.Now; // order_Item.Opmerking = txt_Opmerking.Text; // foreach (Order order in orders) // { // } // orders = order_Items_Service.Add_To_Order(); //} } }
private void btn_StatTafel2_Click(object sender, EventArgs e) { //Verberg alle andere panels pnl_StatusOverzicht.Hide(); pnl_OrderBevestiging.Hide(); pnl_OpenOrders.Hide(); pnl_TafelOverzicht.Hide(); //Toon bestelling panel en verander tafel pnl_TafelNAV.Show(); lbl_StatusOverzicht.Text = "Tafel 2"; Tafel tafel_ID = new Tafel(); tafel_ID.Tafel_ID = 2; Order_Service order_Service = new Order_Service(); Order order = order_Service.DB_Get_Order_By_Tafel(tafel_ID.Tafel_ID); Order_Items_Service order_Items_Service = new Order_Items_Service(); List <Order_Item> order_Items = order_Items_Service.DB_Get_Order_Items_By_Tafel(tafel_ID.Tafel_ID, order.Order_ID); tafel_Service tafel_Status = new tafel_Service(); List <Tafel> tafels = tafel_Status.Get_Tafels(); //Get correct orders pnl_OpenOrders.Show(); listView_OrderOverzicht.Clear(); foreach (Order_Item item in order_Items) { ListViewItem list = new ListViewItem(item.Menu_Item_ID.ToString()); list.SubItems.Add(item.status.ToString()); list.SubItems.Add(item.Hoeveelheid.ToString()); list.SubItems.Add(item.Tijd.ToString()); list.SubItems.Add(item.Opmerking); listView_OrderOverzicht.Items.Add(list); } //foreach (Tafel tafel in tafels) //{ // if (tafel.Tafel_Status == Tafel_Status.Bezet) // { // } // else // { // pnl_BestellingOpnemen.Show(); // } //} }
private void Bediening_Load(object sender, EventArgs e) { pnl_StatusOverzicht.Show(); pnl_TafelNAV.Show(); pnl_OrderBevestiging.Hide(); pnl_TafelOverzicht.Hide(); pnl_BestellingOpnemen.Hide(); pnl_OpenOrders.Hide(); tafel_Service tafel_Status = new tafel_Service(); List <Tafel> tafels = tafel_Status.Get_Tafels(); foreach (Tafel tafel in tafels) { if (tafel.Tafel_ID == 1) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel1.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel1.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel1.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 2) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel2.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel2.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel2.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 3) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel3.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel3.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel3.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 4) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel4.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel4.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel4.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 5) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel5.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel5.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel5.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 6) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel6.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel6.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel6.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 7) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel7.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel7.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel7.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 8) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Tafel8.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Tafel8.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Tafel8.BackColor = Color.FromArgb(236, 84, 63); } } } }
private void lbl_TafelOverzicht_Click(object sender, EventArgs e) { pnl_TafelOverzicht.Show(); pnl_TafelNAV.Show(); pnl_StatusOverzicht.Hide(); pnl_OpenOrders.Hide(); pnl_BestellingOpnemen.Hide(); pnl_OrderBevestiging.Hide(); //Verander Tafel_NAV lbl_TafelOverzicht.ForeColor = Color.White; lbl_TafelOverzicht.Font = new Font("Calibri", 14, FontStyle.Bold); lbl_StatusOverzicht.ForeColor = Color.Gainsboro; lbl_StatusOverzicht.Font = new Font("Calibri", 13, FontStyle.Regular); //Zet kleuren van tafels tafel_Service tafel_Status = new tafel_Service(); List <Tafel> tafels = tafel_Status.Get_Tafels(); foreach (Tafel tafel in tafels) { if (tafel.Tafel_ID == 1) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf1.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf1.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf1.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 2) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf2.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf2.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf2.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 3) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf3.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf3.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf3.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 4) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf4.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf4.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf4.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 5) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf5.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf5.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf5.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 6) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf6.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf6.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf6.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 7) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf7.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf7.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf7.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 8) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf8.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf8.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf8.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 9) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf9.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf9.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf9.BackColor = Color.FromArgb(236, 84, 63); } } else if (tafel.Tafel_ID == 10) { if (tafel.Tafel_Status == Tafel_Status.Open) { btn_Taf10.BackColor = Color.FromArgb(25, 211, 118); } else if (tafel.Tafel_Status == Tafel_Status.Gereserveerd) { btn_Taf10.BackColor = Color.FromArgb(86, 84, 255); } else { btn_Taf10.BackColor = Color.FromArgb(236, 84, 63); } } } }