Dim bm As WinForm.ComboBox = e.Form.Controls("部门")
Dim zh As WinForm.TextBox = e.Form.Controls("账号")
Dim mm As WinForm.TextBox = e.Form.Controls("密码")
Dim xm As WinForm.ComboBox = e.Form.Controls("姓名")
If bm.Value ="" Then
MessageBox.Show
("请选择部门!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
If xm.Value ="" Then
MessageBox.Show
("请选择姓名!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
If zh.Value ="" Then
MessageBox.Show
("请输入账号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
If mm.value = "" Then
MessageBox.Show
("密码不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
'判断部门、姓名、账号、密码是否一致?
Dim dr As DataRow = DataTables("用户管理").Find("账号 = '" & zh.text
& "'")
If dr Is Nothing Then
MessageBox.Show
("账号不存在,请确认账号是否注册!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
If mm.value=
dr("密码") Then
Forms("登录").close
'' Forms("主窗口").open()
Else
mm.Value
=""
MessageBox.Show
("密码错误,请重新输入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
''Dim bmyz As String = dr("部门")
''If bm.value <> bmyz Then
''
MessageBox.Show ("账号与部门不一致!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
'' Return
''End If
''Dim dr1 As DataRow = DataTables("用户管理").Find("姓名
= '" & _UserName & "'")
'用户名
''If dr1 IsNot Nothing AndAlso dr("密码")
= _UserPassword Then
''Dim dr As DataRow = DataTables("用户管理").Find("姓名
= '" & userName & "'")
'用户名
''If dr IsNot Nothing AndAlso dr("密码") =
Password Then
'' Verified
= True
''End If
_UserGroup = dr("部门") '用户部门,给全局代码赋值,对登陆没影响
_UserPost = dr("职务") '用户职务,给全局代码赋值,对登陆没影响
_UserName =dr("姓名") '用户姓名,给全局代码赋值,对登陆没影响
_UserAccount = dr("账号") '用户账号,给全局代码赋值,对登陆没影响
_UserPassword = dr("密码") '用户密码,给全局代码赋值,对登陆没影响