Ejemplo n.º 1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(userName.Text.Trim()))
     {
         MessageBox.Show("用户名不能为空!");
         return;
     }
     if (string.IsNullOrEmpty(passWord.Text))
     {
         MessageBox.Show("密码不能为空!");
         return;
     }
     cis_model.sys.SysUser UserEntity = sysUserBiz.FindByUsername(userName.Text.Trim());
     if (UserEntity != null && UserEntity.Password.Equals(passWord.Text))//验证
     {
         UserInfo.Username = userName.Text.Trim();
         userType          = UserEntity.UserType;
         DialogResult      = DialogResult.OK;
     }
     else
     {
         MessageBox.Show("用户名或密码错误!");
         //return;
     }
 }