Example #1
0
 private void passwordBox_TextChanged(object sender, EventArgs e)
 {
     if (userIdBox.Text == "2")
     {
         ViewForAdmin va = new ViewForAdmin();
     }
     else if (passwordBox.Text == "admincode")
     {
         ViewForAdmin va = new ViewForAdmin();
         va.Show();
     }
 }
Example #2
0
 public void CheckUserStatus()
 {
     if (LogINController.session.AdminSession == true)
     {
         ViewForAdmin viewforadmin = new ViewForAdmin(userIdBox.Text);
         this.Hide();
         viewforadmin.Show();
     }
     else
     {
         MessageBox.Show("Inte Admin");
     }
 }
Example #3
0
 public void ValidateUserInput()
 {
     if (userIdBox.Text.Length < 1 && passwordBox.Text.Length < 1)
     {
         MessageBox.Show("Vänligen fyll i dina uppgifter");
     }
     if (userIdBox.Text == "22")
     {
         ViewForAdmin va = new ViewForAdmin();
     }
     else if (passwordBox.Text == "admincode")
     {
         ViewForAdmin va = new ViewForAdmin();
         va.Show();
     }
     else
     {
         MessageBox.Show("Wrong code");
     }
 }
Example #4
0
 public void TryCreateSession()
 {
     userSession = LogINController.CreateSession(userIdBox.Text, passwordBox.Text);
     if (userSession == null)
     {
         MessageBox.Show("Fel användarnamn eller lösenord!!");
     }
     else if (userSession.AdminSession == true)
     {
         ViewForAdmin viewforadmin = new ViewForAdmin(userIdBox.Text);
         this.Hide();
         viewforadmin.Show();
     }
     else if (userSession.AdminSession == false)
     {
         AlumnView alumn = new AlumnView(userSession, userIdBox.Text);
         this.Hide();
         alumn.Show();
     }
 }