Dim bm As WinForm.TextBox = 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
Dim fdr As DataRow = DataTables("账号密码").Find("账号 = '" & zh.text & "'")
If fdr IsNot Nothing Then
Dim mms As String = fdr("密码")
If mm.value= mms Then
vars("当前用户") = fdr
Dim tbs() As String = { "分公司管理", "外经证管理", "保证金管理" }
If tbs IsNot Nothing Then
For Each tb As String In tbs
DataTables(tb).LoadFilter = "所属机构 = '" & vars("当前用户")("部门") & "'"
DataTables(tb).load
Next
e.Form.close
End If
Else
MessageBox.Show ("密码错误!","提示",MessageBoxButtons.OK)
End If
Else
MessageBox.Show ("账号不存在","提示",MessageBoxButtons.OK)
End If