//Method that is called when a table is clicked private void Table_Click(object sender, EventArgs e) { Button button = (Button)sender; DiningTable table = (DiningTable)button.Tag; switch (table.Status) { case TableStatus.Free: //Brings waiter to the table view OrderForm orderForm = new OrderForm(LoggedInEmployee, loginForm, this, table); orderForm.Show(); Hide(); break; case TableStatus.Occupied: //Will change to current order overview eventually OrderOptionForm optionForm = new OrderOptionForm(LoggedInEmployee, loginForm, orderDB.GetCompleteActiveOrderByTable(table), this); optionForm.Show(); Hide(); break; case TableStatus.Reserved: MessageBox.Show("Table is reserved has the right guest arrived?"); // Some other code OrderForm orderForm1 = new OrderForm(LoggedInEmployee, loginForm, this, table); orderForm1.Show(); break; default: throw new Exception("Incorrect table status input"); } }
private void btn_Cancel_Click(object sender, EventArgs e) { this.Hide(); OrderOptionForm optionForm = new OrderOptionForm(LoggedInEmployee, this.loginForm, order, tableView); optionForm.ShowDialog(); }