private void btnConfirm_Click(object sender, EventArgs e) { try { if (txtTime.Text.Equals("")) { throw new Exception("empty time field"); } else { string msg = "Order Confirmed"; int time = int.Parse(txtTime.Text); // int condition = 1; orderMenu menu = orderMenu.getInstance(); menu.setChefMsg(msg, time); menu.orderconfirm(); menu.Show(); gridDisplay.Rows.Clear(); } } catch (Exception g) { MessageBox.Show(g.Message.ToString()); } }
private void btnSignIn_Click(object sender, EventArgs e) { try { if (txtUser.Text.Equals("")) { MessageBox.Show("empty username"); } else if (txtPass.Text.Equals("")) { MessageBox.Show("empty password"); } else if (login.validate(txtUser.Text, txtPass.Text) == 0) { this.Hide(); MessageBox.Show("Welcome Admin"); Admin admin = new Admin(); admin.setMsg(login.getMsg()); admin.Show(); } else if (login.validate(txtUser.Text, txtPass.Text) == 1) { this.Hide(); orderMenu menu = orderMenu.getInstance(); MessageBox.Show("Welcome User"); menu.Show(); } } catch (Exception f) { MessageBox.Show("invalid username or password"); } }
public static orderMenu getInstance() { if (instance == null || instance.IsDisposed) { instance = new orderMenu(); } return(instance); }
private void btnDecline_Click(object sender, EventArgs e) { try { string msg = "Order Declined"; gridDisplay.Rows.Clear(); orderMenu menu = orderMenu.getInstance(); menu.setChefMsgDec(msg); } catch (Exception g) { MessageBox.Show(g.Message.ToString()); } }