Пример #1
0
 private void button6_Click(object sender, EventArgs e)
 {
     try
     {
         LogInScreen.current_user = RegistrationDatabase.GetUser(comboBox1.Text);
         StudentDashboard form2 = new StudentDashboard();
         form2.Show();
     } catch
     {
         Console.WriteLine("Oops");
     }
 }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            current_user = User.LogIn(user_textbox.Text, pass_textbox.Text);

            if (current_user is null)
            {
                bad_login_message.Visible = true;
            }
            else
            {
                if (current_user is Student)
                {
                    StudentDashboard form2 = new StudentDashboard();
                    form2.Show();
                }
                else if (current_user is Faculty)
                {
                    ProfessorDashboard form2 = new ProfessorDashboard();
                    form2.Show();
                }
                else if (current_user is Admin)
                {
                    admin_perms = true;
                    if (current_user.GetStatus() == "manager")
                    {
                        AdminManagerDashboard form2 = new AdminManagerDashboard();
                        form2.Show();
                    }
                    else
                    {
                        AdminDashboard form2 = new AdminDashboard();
                        form2.Show();
                    }
                }
                Hide();
            }
        }