Example #1
0
        private void LoginPan_Click(object sender, EventArgs e)
        {
            String username = UsernameText.Text;
            String password = PasswordText.Text;

            if (Student.Checked)
            {
                userdao ud = new userdao();
                if (ud.findUser(username, password))
                {
                    DialogResult   dr  = MessageBoxEx.Show(this, "学生登录成功");
                    UserChooseForm ucf = new UserChooseForm();
                    ucf.username      = username;
                    ucf.Location      = this.Location;
                    ucf.StartPosition = FormStartPosition.Manual;
                    ucf.Show();
                }
                else
                {
                    DialogResult dr = MessageBoxEx.Show(this, "用户名密码错误,登录失败");
                }
            }
            else
            {
                admindao ad = new admindao();
                if (ad.findadmin(username, password))
                {
                    DialogResult dr = MessageBoxEx.Show(this, "管理员登录成功");
                    backspace    bk = new backspace();
                    bk.Location      = this.Location;
                    bk.StartPosition = FormStartPosition.Manual;
                    bk.Show();
                }
                else
                {
                    DialogResult dr = MessageBoxEx.Show(this, "用户名密码错误,登录失败");
                }
            }
        }
Example #2
0
 public void setFather(backspace fa)
 {
     this.father = fa;
 }