private void Back_Click(object sender, EventArgs e)
        {
            this.Hide();
            studentMain f8 = new studentMain();

            f8.Show();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            studentMain    st  = new studentMain();
            InstructorMain ins = new InstructorMain();
            ManagerMain    ma  = new ManagerMain();
            string         path;
            int            flag = 0;
            string         un   = textBoxun.Text;
            string         ps   = textBoxps.Text;

            path = "student.txt";
            if (FindUser(un, ps, path))
            {
                st.Show(); flag = 1;
            }
            path = "instructor.txt";
            if (FindUser(un, ps, path))
            {
                ins.Show(); flag = 1;
            }
            path = "manager.txt";
            if (FindUser(un, ps, path))
            {
                ma.Show(); flag = 1;
            }
            if (flag == 0)
            {
                ERE.Text = "Wrong password or ID";
            }
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            studentMain f3 = new studentMain();

            f3.Show();
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            studentMain    st  = new studentMain();
            InstructorMain ins = new InstructorMain();
            ManagerMain    ma  = new ManagerMain();


            string un = textBoxun.Text;
            string ps = textBoxps.Text;

            if (!(string.IsNullOrWhiteSpace(un) && string.IsNullOrWhiteSpace(ps)))
            {
                checkUsernamePassword(un, ps);
                if (FindUser(un, ps, "student.txt"))
                {
                    this.Hide(); st.Show();
                }

                else if (FindUser(un, ps, "instructor.txt"))
                {
                    this.Hide(); Task.Delay(1000); ins.Show();
                }

                else if (FindUser(un, ps, "manager.txt"))
                {
                    this.Hide(); Task.Delay(1000); ma.Show();
                }

                else
                {
                    ERE.Text = "Wrong password or ID";
                }
            }
            else
            {
                ERE.Text = "Fill in the password and ID";
            }
        }