private void FinishAddingBtn_Click(object sender, EventArgs e)
        {
            Instructor_Profile f = new Instructor_Profile();

            f.Show();
            this.Hide();
        }
Example #2
0
        private void LoginBtn_Click(object sender, EventArgs e)
        {
            Instructor loggedInstructor = null;
            Student    loggedStudent    = null;
            Admin      loggedAdmin      = null;

            if (insRadBtn.Checked)
            {
                loggedInstructor = InstructorDAL.GetByUserNameAndPassword(UserNameTextBox.Text, PasswordTextBox.Text);
                if (loggedInstructor == null)
                {
                    MessageBox.Show("Please Insert Correct Data For Instructor");
                }
                else
                {
                    loggedInstructor        = InstructorDAL.GetByUserNameAndPassword(UserNameTextBox.Text, PasswordTextBox.Text);
                    MyInstructor.Instructor = loggedInstructor;
                    Instructor_Profile f = new Instructor_Profile();
                    f.Show();
                    this.Hide();
                }
            }
            else if (studRadBtn.Checked)
            {
                loggedStudent = StudentDAL.GetByUserNameAndPassword(UserNameTextBox.Text, PasswordTextBox.Text);
                if (loggedStudent == null)
                {
                    MessageBox.Show("Please Insert Correct Data For Student");
                }
                else
                {
                    MyStudent.Student = loggedStudent;
                    Student_Profile f = new Student_Profile();
                    f.Show();
                    this.Hide();
                }
            }
            else
            {
                loggedAdmin = AdminDAL.GetByUserNameAndPassword(UserNameTextBox.Text, PasswordTextBox.Text);
                if (loggedAdmin == null)
                {
                    MessageBox.Show("Please Insert Correct Data For Admin");
                }
                else
                {
                    MyAdmin.Admin = loggedAdmin;
                    AdminProfile adm = new AdminProfile();
                    adm.Show();
                    this.Hide();
                }
            }
        }