private void loginButton_Click(object sender, EventArgs e)
        {
            verifyLogin vl = new verifyLogin();

            bool checklog = vl.verifyLogstudent(UsernameBox.Text, PasswordBox.Text);

            if (checklog)
            {
                label1.Text      = "succesfully";
                label1.ForeColor = System.Drawing.Color.LightGreen;
                label1.Visible   = true;
                int           id       = vl.StudentID;
                String        username = UsernameBox.Text;
                StudentScreen ss       = new StudentScreen
                {
                    StudentID1      = id,
                    StudentUsername = username
                };

                this.Close();


                ss.Show();
            }
            else
            {
                label1.ForeColor = System.Drawing.Color.Red;
                label1.Visible   = true;
                label1.Text      = "You entered wrong username or password. Please try again.";
            }
        }
예제 #2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            verifyLogin vl = new verifyLogin();


            bool checklog = vl.verifyLogteacher(UsernameBox.Text, PasswordBox.Text);

            if (checklog)
            {
                label1.Visible = true;
                int    id       = vl.TeacherID;
                String username = UsernameBox.Text;

                TeacherScreen ts = new TeacherScreen()
                {
                    teacherId = id
                };


                this.Close();
                ts.Show();
            }
            else
            {
                label1.ForeColor = System.Drawing.Color.Red;
                label1.Text      = "You entered wrong username or password.Please try again.";
                label1.Visible   = true;
            }
        }