狐狸爸爸,全部代码如下
Dim bm As WinForm.ComboBox = e.Form.Controls("部门")
Dim zh As WinForm.TextBox = e.Form.Controls("账号")
Dim mm As WinForm.TextBox = e.Form.Controls("密码")
If bm.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
MessageBox.Show(1)
'判断部门账号是否一致
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
Dim dr As DataRow
dr = DataTables("账号密码").Find("账号 = '" & zh.text & "'")
_UserName = dr("账号")
_UserGroup = dr("部门")
_UserPassword = dr("密码")
MessageBox.Show(2)
If dr Is Nothing Then
msgbox("账号不存在")
Return
End If
Dim bmyz As String = dr("部门")
If bm.value <> bmyz Then
MessageBox.Show ("账号与部门不一致!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
MessageBox.Show(3)
'分机构/部门加载表中的行数据
Dim fdr As DataRow = DataTables("账号密码").Find("账号 = '" & zh.text & "'")
If fdr IsNot Nothing Then
Dim mms As String = fdr("密码")
If mm.value= mms Then
MessageBox.Show(4)
'判断是否通过审核,标记为-1时,提示未通过审核,为1时直接登录
Dim bj As WinForm.TextBox = e.Form.Controls("标记")
If bj.value = "-1" Then
MessageBox.Show ("您未通过管理员审核,请与管理员联系!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
If bj.value = "1" Then
Forms("管理员登录").close
Else
Forms("管理员登录").close
MainTable = Tables("主界面")
Forms("主窗口").open
Forms("导航窗口上").open
Forms("导航窗口").open
End If
Else
MessageBox.Show ("密码错误,请重新输入!","提示",MessageBoxButtons.OK)
Return
End If
End If