private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "Trey" && radioButton1.Checked)
            {
                studentView Sview = new studentView();
                Sview.Show();
                Hide();
            }

            if (textBox1.Text == "Max" && radioButton2.Checked)
            {
                ProfessorView PView = new ProfessorView();
                PView.Show();
                Hide();
            }

            if (textBox1.Text == "Max" && radioButton3.Checked)
            {
                string            message = "You are not a registrar.";
                string            caption = "Authentification Error";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                DialogResult      result;

                // Displays the MessageBox.

                result = MessageBox.Show(message, caption, buttons);
            }
        }
예제 #2
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();
            }
        }