Exemplo n.º 1
0
        public void LogInButton_Click(object sender, EventArgs e)
        {
            int.TryParse(UserNameTextBox.Text, out int UserID);
            int ID = UserID;

            if (user.Authenticate(UserID, PasswordTextBox.Text))
            {
                if (user.IsRegistrar)
                {
                    Registrar RView = new Registrar();
                    RView.Show();
                    Hide();
                }
                else if (user.IsProfessor)
                {
                    ProfessorView PView = new ProfessorView();
                    PView.Show();
                    Hide();
                }
                else if (user.IsStudent)
                {
                    StudentView SView = new StudentView();
                    SView.Show();
                    Hide();
                }
            }
            else
            {
                MessageBox.Show("Invaild credentials!!");
            }
        }
        private void UserViewComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProfessorView Professor = new ProfessorView();
            StudentView   Student   = new StudentView();
            Registrar     Registar  = new Registrar();

            if (UserViewComboBox.SelectedItem.ToString() == "Student")
            {
                Student.Show();
                Close();
            }
            if (UserViewComboBox.SelectedItem.ToString() == "Professor")
            {
                Professor.Show();
                Close();
            }
            if (UserViewComboBox.SelectedItem.ToString() == "Registar")
            {
                Registar.Show();
                Close();
            }
        }