Ejemplo n.º 1
0
        private void LoginUserCheck(int dept)
        {
            //Check in database function (IDK how the database is going to work, or even what it's going to upload. So I'll pretend it does something ehre.
            int UserStatus = dept; //This would be int UserStatus = Database.UserCheck(user, password);

            if (UserStatus >= 1)
            {
                UserStatus = 1;
            }

            switch (UserStatus)
            {
            // Can't find user in database
            case -1:
                UIUserLoginButton.Text = ("Wrong password.  Try again");
                break;

            // User is department
            case 1:
                this.Hide();
                DepartmentScreen FormDepart = new DepartmentScreen();
                FormDepart.ShowDialog();
                //this.Show();
                //Application.Exit();
                break;

            default:
                // User is oversight
                this.Hide();
                OversightScreen FormOver = new OversightScreen();
                FormOver.ShowDialog();
                //Application.Exit();
                break;
            }
        }
Ejemplo n.º 2
0
        private void DBLoginOversight_Click(object sender, EventArgs e)
        {
            this.Hide();
            OversightScreen FormOver = new OversightScreen();

            FormOver.ShowDialog();
            Application.Exit();
        }
        private void StenerMang_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Hide();
            OversightScreen FormOver = new OversightScreen();

            FormOver.ShowDialog();
            Application.Exit();
            this.Close();
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            STENER c = new STENER();

            c.D_id = Int32.Parse(d_idBox.Text);
            c.CreateS(c);
            this.Hide();
            OversightScreen FormDepart = new OversightScreen();

            FormDepart.ShowDialog();
        }
Ejemplo n.º 5
0
        private void DeleteUserBtn_Click(object sender, EventArgs e)
        {
            User c = new User();

            c.UserID = int.Parse(Array[listBox2.SelectedIndex - 1][0]);

            c.DeleteUser(c);
            this.Hide();
            OversightScreen FormDepart = new OversightScreen();

            FormDepart.ShowDialog();
        }
Ejemplo n.º 6
0
        private void AddQBtn_Click(object sender, EventArgs e)
        {
            Questions c = new Questions();

            c.Question = QuestionBox.Text;
            c.S_id     = Int32.Parse(sIDBox.Text);
            c.CreateQ(c);

            this.Hide();
            OversightScreen FormDepart = new OversightScreen();

            FormDepart.ShowDialog();
        }
Ejemplo n.º 7
0
        private void AddUserBtn_Click(object sender, EventArgs e)
        {
            User c = new User();

            c.Fname    = FnameBox.Text;
            c.Lname    = LnameBox.Text;
            c.DeptID   = Int32.Parse(dIDBox.Text);
            c.Username = UsernameBox.Text;
            c.Password = PasswordBox.Text;
            Console.WriteLine(c.Fname + c.Lname + c.DeptID + c.Username + c.Password);
            c.AddUser(c);
            this.Hide();
            OversightScreen FormDepart = new OversightScreen();

            FormDepart.ShowDialog();
        }