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(); } }
public void CheckUserStatus() { if (LogINController.session.AdminSession == true) { ViewForAdmin viewforadmin = new ViewForAdmin(userIdBox.Text); this.Hide(); viewforadmin.Show(); } else { MessageBox.Show("Inte Admin"); } }
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"); } }
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(); } }