コード例 #1
0
 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());
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: bqhussain/ISD-Project-5B
 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");
     }
 }
コード例 #3
0
ファイル: Menu.cs プロジェクト: bqhussain/ISD-Project-5B
 public static orderMenu getInstance()
 {
     if (instance == null || instance.IsDisposed)
     {
         instance = new orderMenu();
     }
     return(instance);
 }
コード例 #4
0
 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());
     }
 }