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

            f8.Show();
        }
Example #2
0
        private void Back_btn_Click(object sender, EventArgs e)
        {
            Hide();
            InstructorMain sm = new InstructorMain();

            sm.Show();
        }
        private void backBTN_Click(object sender, EventArgs e)
        {
            this.Hide();
            InstructorMain f4 = new InstructorMain();

            f4.Show();
        }
Example #4
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";
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            InstructorMain sm = new InstructorMain();

            sm.Show();
        }
        private void sendBTN_Click(object sender, EventArgs e)
        {
            studentMain    st   = new studentMain();
            InstructorMain ins  = new InstructorMain();
            ManagerMain    ma   = new ManagerMain();
            int            flag = 0;
            string         un   = textBoxun.Text;

            if (un != "")
            {
                if (FindUser(un, "student.txt"))
                {
                    flag = 1;
                }
                else if (FindUser(un, "instructor.txt"))
                {
                    flag = 1;
                }
                else if (FindUser(un, "manager.txt"))
                {
                    flag = 1;
                }
                if (flag == 1)
                {
                    char s = ' ';

                    StreamReader mi      = new StreamReader("user.txt");
                    string       line    = mi.ReadLine();
                    string[]     details = line.Split(' ');
                    string       idM     = details[0];
                    mi.Close();

                    string       message = un + s + idM + s + textBoxMessage.Text + "\r\nEOMessage";
                    StreamWriter mw      = new StreamWriter("messages.txt", true);
                    mw.WriteLine(message);
                    mw.Close();

                    messageLBL.Text = "Message sent";
                }
                else
                {
                    messageLBL.Text = "Wrong password or ID";
                }
            }
            else
            {
                messageLBL.Text = "Fill in the ID or message";
            }
        }
Example #7
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";
            }
        }