//Room Booking Edit Close private void RoomBookingEdit_Closed(object sender, FormClosedEventArgs e) { if (cancelled) { pnlRoomSelect.Visible = false; Globals.firstLoad = true; picTabDisplay_Click(sender, e); } else { pnlRoomSelect.Visible = true; pnlRoomSelect.BringToFront(); Globals.firstLoad = false; RoomSelect frm = new RoomSelect(); frm.TopLevel = false; frm.FormBorderStyle = FormBorderStyle.None; frm.WindowState = FormWindowState.Maximized; frm.FormClosing += RoomSelect_Closing; frm.FormClosed += RoomSelect_Closed; pnlRoomSelect.Controls.Add(frm); frm.Show(); } }
private void picTabAdd_Click(object sender, EventArgs e) { tabSelected = 2; switch (menuSelected) { case 0: //Welcome break; case 1: //Room Booking pnlRoomSelect.BringToFront(); pnlRoomSelect.Visible = true; RoomSelect frm = new RoomSelect(); frm.TopLevel = false; frm.FormBorderStyle = FormBorderStyle.None; frm.WindowState = FormWindowState.Maximized; frm.FormClosing += RoomSelect_Closing; frm.FormClosed += RoomSelect_Closed; pnlRoomSelect.Controls.Add(frm); frm.Show(); break; case 2: //Room Service RoomServiceAdd frm2 = new RoomServiceAdd(); frm2.TopLevel = false; frm2.FormBorderStyle = FormBorderStyle.None; frm2.WindowState = FormWindowState.Maximized; frm2.FormClosed += RoomServiceAdd_Closed; pnlMainBody.Controls.Add(frm2); frm2.Show(); break; case 3: //Table Booking pnlTableSelect.BringToFront(); pnlTableSelect.Visible = true; TableSelect form = new TableSelect(); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.WindowState = FormWindowState.Maximized; form.FormClosed += TableSelect_Closed; pnlTableSelect.Controls.Add(form); form.Show(); break; case 4: //Restaurant Stock RestaurantStockAdd frm4 = new RestaurantStockAdd(); frm4.TopLevel = false; frm4.FormBorderStyle = FormBorderStyle.None; frm4.WindowState = FormWindowState.Maximized; frm4.FormClosed += RestaurantStockAdd_Closed; pnlMainBody.Controls.Add(frm4); frm4.Show(); break; case 5: //Staff break; case 6: //Administration Staff StaffAdd frm6 = new StaffAdd(); frm6.TopLevel = false; frm6.FormBorderStyle = FormBorderStyle.None; frm6.WindowState = FormWindowState.Maximized; frm6.FormClosed += StaffAdd_Closed; pnlMainBody.Controls.Add(frm6); frm6.Show(); break; } if (menuSelected != 2) { //Diable Selected Tab and Edit Tab picTabAdd.Enabled = false; picTabEdit.Enabled = false; //Enable All Other Tabs picTabDisplay.Enabled = true; picTabSearch.Enabled = true; picTabDelete.Enabled = true; } else { //Diable Selected Tab and Edit Tab picTabAdd.Enabled = false; //Enable All Other Tabs picTabDisplay.Enabled = true; picTabSearch.Enabled = true; picTabDelete.Enabled = true; picTabEdit.Enabled = true; } }