Dim organName As String = e.Form.Controls("organName").Value
Dim userRole As String = e.Form.Controls("userRole").Value
Dim userName As String = e.Form.Controls("userName").Value
Dim dt As DataTable
Dim dr As DataRow
''判断是否存在
cmd.CommandText = "选择 * From {user} Where [organName]='" & organName & "' And [userRole]='" & userRole & "' And [userName]='" & userName & "' "
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
If e.Form.Controls("userPassword").Value = dr("userPassword") Then
_UserName = UserName
_UserOrgan = dr("organName")
_UserRole = dr("userRole")
''权限控制
If _UserRole ="查询员" Then
'DataTables("person").LoadFilter = ""
'DataTables("organList").LoadFilter = ""
'DataTables("history").LoadFilter = ""
'DataTables("user").LoadFilter = ""
'For Each t As Table In Tables
't.AllowEdit = False
'Next
RibbonTabs("单位管理").Groups("").Visible=False
RibbonTabs("部门管理").Groups("").Visible=False
RibbonTabs("人员管理").Groups("").Visible=False
RibbonTabs("历史库管理").Groups("").Visible=False
RibbonTabs("用户管理").Groups("").Visible=False
ElseIf _UserRole ="管理员" Then
'
'''县支行管理员看不到单位管理模块
Dim dr1 = DataTables("organList").SQLFind(" organName = '" &_UserOrgan & "'")
If dr1 IsNot Nothing Then
Dim fuzhu As String = dr.SQLGetValue("fuZhu")
If fuzhu.Length = 15 Then
RibbonTabs("单位管理").Groups("").Visible=False
Else
RibbonTabs("单位管理").Groups("").Visible=True
End If
End If
RibbonTabs("单位管理").Groups("").Visible=True
RibbonTabs("部门管理").Groups("").Visible=True
RibbonTabs("人员管理").Groups("").Visible=False
RibbonTabs("历史库管理").Groups("").Visible=False
RibbonTabs("用户管理").Groups("").Visible=True
ElseIf _UserRole ="操作员" Then
'
RibbonTabs("单位管理").Groups("").Visible=False
RibbonTabs("部门管理").Groups("").Visible=False
RibbonTabs("人员管理").Groups("").Visible=True
RibbonTabs("历史库管理").Groups("").Visible=True
RibbonTabs("用户管理").Groups("").Visible=False
Else
Messagebox.show("当前用户角色为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
e.Form.BaseForm.Opacity = 0
e.Form.Close
Forms("首页").Open
basemainform.visible = True
'ConfigBar.Items("标签1").Text=Date.Today & " " & _UserOrgan & " " & _UserRole & " " & _UserName
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
此主题相关图片如下:1.png
[此贴子已经被作者于2018/9/26 22:40:04编辑过]