private void btnLogin_Click(object sender, EventArgs e) { UserService us = new UserService(); us.UserValidate = new CKGLDAL <User>(this.db); var name = txtName.Text; var pwd = txtPwd.Text; bool result = us.Login(name, pwd); if (!result) { //用户登录失败 ShowPrompt("用户名或密码错误!"); } else { //用户登录成功 manageForm = new MangeForm(us, this); manageForm.Show(); this.Hide(); } }
private void btnLogin_Click(object sender, EventArgs e) { UserLogin login = new UserLogin(); login.UserValidate = new CKGLDAL(); //用户输入的过滤 var name = txtName.Text; var pwd = txtPwd.Text; User user = login.Login(name, pwd); if (user == null) { //用户登录失败 ShowPrompt("用户名或密码错误!"); } else { //用户登录成功 manageForm = new MangeForm(user, this); manageForm.Show(); this.Hide(); } }
private void btnLogin_Click(object sender, EventArgs e) { UserLogin login = new UserLogin(); login.UserValidate = new CKGLDAL(); //用户输入的过滤 var name = txtName.Text; var pwd = txtPwd.Text; User user = login.Login(name, pwd); if (user == null) { //用户登录失败 ShowPrompt("用户名或密码错误!"); } else { //用户登录成功 manageForm = new MangeForm(user,this); manageForm.Show(); this.Hide(); } }