private void button_Back_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormMenuExamDepartment examDepartment = new FormMenuExamDepartment();

            examDepartment.Show();
        }
        private void button_Back_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormMenuExamDepartment filterCourses = new FormMenuExamDepartment();

            filterCourses.Show();
        }
예제 #3
0
        private void login1()
        {
            if (!link)
            {
                DataRow dataRow = SQLFunctions.checkFbLogIn(fbMail);

                if (dataRow == null)
                {
                    MessageBox.Show("This facebook account is not linked to any system user\nPlease link your Facebook account and try again");
                    B_8.login login = new B_8.login();
                    login.Show();
                }
                else if (SQLFunctions.checkLogIn(Convert.ToInt32(dataRow[0]), dataRow[1].ToString()))
                {
                    if (SQLFunctions.checkRole(Convert.ToInt32(dataRow[0])) == "Student")
                    {
                        FormMenuStudent mainForm = new FormMenuStudent(Convert.ToInt32(dataRow[0]), dataRow[1].ToString());
                        mainForm.Show();
                    }
                    else if (SQLFunctions.checkRole(Convert.ToInt32(dataRow[0])) == "SecretaryA")
                    {
                        FormMenuSecretary mainForm = new FormMenuSecretary(Convert.ToInt32(dataRow[0]), dataRow[1].ToString());
                        mainForm.Show();
                    }
                    else if (SQLFunctions.checkRole(Convert.ToInt32(dataRow[0])) == "Exam Department")
                    {
                        FormMenuExamDepartment mainForm = new FormMenuExamDepartment();
                        mainForm.Show();
                    }
                    else if (SQLFunctions.checkRole(Convert.ToInt32(dataRow[0])) == "Admin")
                    {
                        FormMenuAdmin mainForm = new FormMenuAdmin();
                        mainForm.Show();
                    }
                    else
                    {
                        B_8.login login = new B_8.login(true, SQLFunctions.convertFbMailToMail(fbMail), dataRow[1].ToString());
                    }
                }
            }
            else
            {
                SQLFunctions.linkFbAccount(mail, fbMail);
                MessageBox.Show("Your facebook account was succesfuly linked");
                this.Hide();
            }
        }
예제 #4
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textBoxID.Text == "")
            {
                MessageBox.Show("Logon Failure: unknown ID or invalid password");
                return;
            }

            if (SQLFunctions.checkLogIn(Convert.ToInt32(textBoxID.Text), textBoxPassword.Text))
            {
                this.Hide();

                if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Student")
                {
                    FormMenuStudent mainForm = new FormMenuStudent(Convert.ToInt32(textBoxID.Text), textBoxPassword.Text);
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Secretary")
                {
                    FormMenuSecretary mainForm = new FormMenuSecretary(Convert.ToInt32(textBoxID.Text), textBoxPassword.Text);
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Exam Department")
                {
                    FormMenuExamDepartment mainForm = new FormMenuExamDepartment();
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Admin")
                {
                    FormMenuAdmin mainForm = new FormMenuAdmin();
                    mainForm.Show();
                }
                else
                {
                    MessageBox.Show("Unknown Error");
                }
            }
            else
            {
                MessageBox.Show("Logon Failure: unknown ID or invalid password");
            }
        }
 private void button_Accept_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt32(textBox_grade.Text) < 0 || Convert.ToInt32(textBox_grade.Text) > 100)
     {
         MessageBox.Show("Invalid grade");
     }
     else if (SQLFunctions.isStudentGraded(Convert.ToInt32(textBox1.Text), SQLFunctions.covertCourseNametoCourseID(comboBox_CourseList.Text)) == true)
     {
         SQLFunctions.updateGradeToStudent(Convert.ToInt32(textBox1.Text), SQLFunctions.covertCourseNametoCourseID(comboBox_CourseList.Text), Convert.ToInt32(textBox_grade.Text));
         MessageBox.Show("Student with the ID " + textBox1.Text + " old grade was override, with the grade " + textBox_grade.Text + " in course " + comboBox_CourseList.Text);
         this.Hide();
         FormMenuExamDepartment examDepartment = new FormMenuExamDepartment();
         examDepartment.Show();
     }
     else
     {
         SQLFunctions.addGradeToStudent(Convert.ToInt32(textBox1.Text), SQLFunctions.covertCourseNametoCourseID(comboBox_CourseList.Text), Convert.ToInt32(textBox_grade.Text));
         MessageBox.Show("Student with the ID " + textBox1.Text + " was graded " + textBox_grade.Text + " in course " + comboBox_CourseList.Text);
         this.Hide();
         FormMenuExamDepartment examDepartment = new FormMenuExamDepartment();
         examDepartment.Show();
     }
 }