private void LoginUserCheck(int dept) { //Check in database function (IDK how the database is going to work, or even what it's going to upload. So I'll pretend it does something ehre. int UserStatus = dept; //This would be int UserStatus = Database.UserCheck(user, password); if (UserStatus >= 1) { UserStatus = 1; } switch (UserStatus) { // Can't find user in database case -1: UIUserLoginButton.Text = ("Wrong password. Try again"); break; // User is department case 1: this.Hide(); DepartmentScreen FormDepart = new DepartmentScreen(); FormDepart.ShowDialog(); //this.Show(); //Application.Exit(); break; default: // User is oversight this.Hide(); OversightScreen FormOver = new OversightScreen(); FormOver.ShowDialog(); //Application.Exit(); break; } }
private void DBLoginDpartment_Click(object sender, EventArgs e) { this.Hide(); DepartmentScreen FormDepart = new DepartmentScreen(); FormDepart.ShowDialog(); Application.Exit(); }