private void Form_associateDefineNewEvent_FormClosed(object sender, FormClosedEventArgs e)
        {
            Form_associateMenu parent = (Form_associateMenu)this.Owner;

            parent.Show();
        }
Beispiel #2
0
        private void login()
        {
            db.OpenConn();
            Boolean error = false;

            switch (getAccessGroup())
            {
            case "Admin":
                if (ManagementButton.Checked)
                {
                    getID();
                    using (adminMenu adMenu = new adminMenu(new admin(id)))
                    {
                        this.Hide();
                        adMenu.ShowDialog(this);
                    }
                }
                else if (StudentButton.Checked)
                {
                    using (Form_adminMenu admin_menu = new Form_adminMenu())
                    {
                        this.Hide();
                        admin_menu.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose a button!");
                }
                break;

            case "Student":
                if (StudentButton.Checked)
                {
                    using (Form_studentMenu student_menu = new Form_studentMenu())
                    {
                        student_menu.setUsername(Username);
                        this.Hide();
                        student_menu.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose your right type!");
                }
                break;

            case "Associate":
                if (StudentButton.Checked)
                {
                    using (Form_associateMenu associate_menu = new Form_associateMenu())
                    {
                        this.Hide();
                        associate_menu.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose your right type!");
                }
                break;

            case "Secretary":
                if (ManagementButton.Checked)
                {
                    getID();
                    using (secretaryMenu secMenu = new secretaryMenu(new secretary(id)))
                    {
                        this.Hide();
                        secMenu.ShowDialog(this);
                    }
                }
                else if (StudentButton.Checked)
                {
                    using (Form_secretaryMenu secretary_menu = new Form_secretaryMenu())
                    {
                        this.Hide();
                        secretary_menu.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose a button!");
                }
                break;

            case "instructor":
                if (ManagementButton.Checked)
                {
                    getID();
                    using (teachingStaffMenu instrfMen = new teachingStaffMenu(new professor(id)))
                    {
                        this.Hide();
                        instrfMen.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose your right type!");
                }
                break;

            case "Professor":
                if (ManagementButton.Checked)
                {
                    getID();
                    using (teachingStaffMenu porfMen = new teachingStaffMenu(new professor(id)))
                    {
                        this.Hide();
                        porfMen.ShowDialog(this);
                    }
                }
                else
                {
                    MessageBox.Show("You must choose your right type!");
                }
                break;

            default:
                MessageBox.Show(getAccessGroup());
                error = true;
                break;
            }
            if (!error)
            {
                this.Show();
                this.BringToFront();
                this.userNameBox.Clear();
                this.passwordBox.Clear();
                this.ManagementButton.Checked = false;
                this.StudentButton.Checked    = false;
            }

            db.CloseConn(db.ConnStatus());
        }
Beispiel #3
0
        private void Form_associateRemoveEvent_FormClosed_1(object sender, FormClosedEventArgs e)
        {
            Form_associateMenu parent = (Form_associateMenu)this.Owner;

            parent.Show();
        }