Ejemplo n.º 1
0
 private void signinButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (verifier("frontend".Trim(), usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim()))
         {
             this.Hide();
             Frontend hotel_management = new Frontend();
             hotel_management.Show();
         }
         else if (verifier("kitchen".Trim(), usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim()))
         {
             this.Hide();
             Kitchen kitchen_management = new Kitchen();
             kitchen_management.Show();
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, "Username or Password is wrong, try again", "Login Failed", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MetroFramework.MetroMessageBox.Show(this, ex.ToString(), "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
     }
 }