private void button_Back_Click(object sender, EventArgs e)
        {
            FormMenuSecretary secForm = new FormMenuSecretary(id, password);

            this.Hide();
            secForm.Show();
        }
Beispiel #2
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (SQLFunctions.checkLogIn(Convert.ToInt32(textBoxID.Text), textBoxPassword.Text))
            {
                this.Hide();

                if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Student")
                {
                    FormMenuStudent mainForm = new FormMenuStudent();
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Secretary")
                {
                    FormMenuSecretary mainForm = new FormMenuSecretary();
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Exam Department")
                {
                    FormMenuExamDepratment mainForm = new FormMenuExamDepratment();
                    mainForm.Show();
                }
                else if (SQLFunctions.checkRole(Convert.ToInt32(textBoxID.Text)) == "Admin")
                {
                }
                else
                {
                    MessageBox.Show("Unknown Error");
                }
            }
            else
            {
                MessageBox.Show("Logon Failure: unknown ID or bad password");
            }
        }
Beispiel #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();
            }
        }
        private void button_accept_Click(object sender, EventArgs e)
        {
            int lectureID;

            if ((2000 + Convert.ToInt32(textBox_year.Text) < 2100) && (2000 + Convert.ToInt32(textBox_year.Text) > 2000) && (Convert.ToInt32(textBox_month.Text) < 13) && (Convert.ToInt32(textBox_month.Text) > 0))
            {
                if (!(Convert.ToInt32(textBox_day.Text) > DateTime.DaysInMonth(2000 + Convert.ToInt32(textBox_year.Text), Convert.ToInt32(textBox_month.Text)) || Convert.ToInt32(textBox_day.Text) < 0))
                {
                    if ((Convert.ToInt32(textBox_StartTime.Text) >= 8 && Convert.ToInt32(textBox_StartTime.Text) <= 21) && (Convert.ToInt32(textBox_EndTime.Text) >= 8 && Convert.ToInt32(textBox_EndTime.Text) <= 21) && (Convert.ToInt32(textBox_StartTime.Text) < Convert.ToInt32(textBox_EndTime.Text)))
                    {
                        if (comboBox_AddRemove.SelectedIndex == 0)
                        {
                            if (comboBox_Lectures.SelectedItem.ToString() != "All")
                            {
                                lectureID = lectureIDS[comboBox_Lectures.SelectedIndex];
                                SQLFunctions.addChange(textBox_description.Text, Convert.ToInt32(textBox_StartTime.Text), Convert.ToInt32(textBox_EndTime.Text), Convert.ToInt32(textBox_day.Text), Convert.ToInt32(textBox_month.Text), 2000 + Convert.ToInt32(textBox_year.Text), lectureID);
                            }
                            else
                            {
                                SQLFunctions.addChange(textBox_description.Text, Convert.ToInt32(textBox_StartTime.Text), Convert.ToInt32(textBox_EndTime.Text), Convert.ToInt32(textBox_day.Text), Convert.ToInt32(textBox_month.Text), 2000 + Convert.ToInt32(textBox_year.Text), 0);
                            }
                        }
                        else
                        {
                            lectureID = lectureIDS[comboBox_Lectures.SelectedIndex];
                            SQLFunctions.addChange("Canceled", Convert.ToInt32(textBox_StartTime.Text), Convert.ToInt32(textBox_EndTime.Text), Convert.ToInt32(textBox_day.Text), Convert.ToInt32(textBox_month.Text), 2000 + Convert.ToInt32(textBox_year.Text), lectureID);
                        }
                        FormMenuSecretary secForm = new FormMenuSecretary(id, password);
                        this.Hide();
                        secForm.Show();
                    }

                    else
                    {
                        MessageBox.Show("Incorrect values");
                    }
                }
                else
                {
                    MessageBox.Show("Incorrect values");
                }
            }
            else
            {
                MessageBox.Show("Incorrect values");
            }
        }