Ejemplo n.º 1
0
        //loginbutton
        private void button1_Click(object sender, EventArgs e)
        {
            u.Username = txtUsername.Text;
            u.Password = txtPassword.Text;

            g.Username = u.Username;

            u.CurrentUsername = u.Username;

            g.GetUserID();

            u.ID = g.ID;

            u.Usertype = g.UsertypeID;

            u.UserLogin();


            if (u.LoginResult == 1)
            {
                this.Hide();

                u.CurrentUsername = u.Username;

                g.GetFirstLogin();

                this.Hide();

                //if (g.FirstLogin==0)
                //{
                g.GetUserType();
                if (g.UsertypeID == 110)
                {
                    AdminLogin();
                }
                else if (g.UsertypeID == 111)
                {
                    TeacherLogin();
                }
                else if (g.UsertypeID == 112)
                {
                    StudentLogin();
                }
                //}
                //else
                //{
                //    FirstLogin();
                //}
            }
            else
            {
                MessageBox.Show("Invalid Username or Password!");
                txtPassword.Text = "";
                FailedCount++;
                if (FailedCount >= 3)
                {
                    lblForgot.Text = "Forgot Password?";
                }
            }
        }
Ejemplo n.º 2
0
        //loginbutton
        private void button1_Click(object sender, EventArgs e)
        {
            u.Username = txtUsername.Text;
            u.Password = txtPassword.Text;

            u.UserLogin(/*txtUsername.Text, txtPassword.Text*/);

            if (u.LoginResult == 1)
            {
                this.Hide();
                UserRegistration r = new UserRegistration();
                u.CurrentUsername = u.Username;
                //u.CurrentUserID = u.ReturnUserID();
                //u.UserLoginLog();
                r.Show();
            }
            else
            {
                MessageBox.Show("lol");
            }
        }