private void btnLogout_Click(object sender, EventArgs e)
        {
            FormAdmin form = new FormAdmin();

            form.Passvalue = Nm;
            form.Show();
            this.Close();
        }
Ejemplo n.º 2
0
 private void Login()
 {
     if (EnrollDatabase.Login(txtUser.Text, txtPassword.Text, cmbType.Text))
     {
         if (cmbType.Text == "admin")
         {
             FormAdmin form = new FormAdmin();
             form.Passvalue = EnrollDatabase.GetName(txtUser.Text);
             form.Show();
             this.Hide();
         }
         else
         {
             FormStudentEnroll form = new FormStudentEnroll();
             form.Passvalue = txtUser.Text;
             form.Show();
             this.Hide();
         }
     }
     else
     {
         MessageBox.Show("Incorrect SN or password", "Unauthorized User", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }