private void backbutton_Click(object sender, EventArgs e)
 {
     if (user == 1)
     {
         Warden wr = new Warden(user);
         this.Hide();
         wr.Show();
     }
     else if (user == 2)
     {
         jailorwindow jw = new jailorwindow(user);
         this.Hide();
         jw.Show();
     }
     else if (user == 3)
     {
         Receptionist_s_Window rw = new Receptionist_s_Window(user);
         this.Hide();
         rw.Show();
     }
     else
     {
         MessageBox.Show("Error");
     }
 }
        private void backbutton_Click(object sender, EventArgs e)
        {
            Warden w = new Warden();

            w.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            if (userIdBox.Text == "" || passwordTextBox.Text == "")
            {
                MessageBox.Show("Username or Password can not be empty");
            }
            else
            {
                int result = login.LoginValidation(userIdBox.Text, passwordTextBox.Text);

                if (result == 1)
                {
                    user = 1;
                    Warden w = new Warden(user);
                    w.Show();
                    this.Hide();
                }
                else if (result == 2)
                {
                    user = 2;
                    jailorwindow j = new jailorwindow(user);
                    j.Show();
                    this.Hide();
                }
                else if (result == 3)
                {
                    user = 3;
                    Receptionist_s_Window r = new Receptionist_s_Window(user);
                    r.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Wrong Password");
                }
            }
        }