For Each i As object In QAT.Items
i.visible = True
i.Enabled = True
Next
For Each i As object In ConfigBar.Items
i.visible = True
i.Enabled = True
Next
For Each dr As DataRow In DataTables("菜单分组权限").Select("用户分组 = '" & _UserGroup & "'")
If dr("菜单分区") = "快速访问栏" Then
If dr.IsNull("二级菜单") Then
QAT(dr("一级菜单")).Visible = Not dr("一级不可见")
QAT(dr("一级菜单")).Enabled = Not dr("一级不可用")
Else
QAT(dr("一级菜单"))(dr("二级菜单")).Visible = Not dr("二级不可见")
QAT(dr("一级菜单"))(dr("二级菜单")).Enabled = Not dr("二级不可用")
End If
ElseIf dr("菜单分区") = "配置栏" Then
If dr.IsNull("二级菜单") Then
ConfigBar(dr("一级菜单")).Visible = Not dr("一级不可见")
ConfigBar(dr("一级菜单")).Enabled = Not dr("一级不可用")
End If
End If
Next
登录界面代码
DataTables("Users").Load() '重新加载
Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * Fro m {Users} Where [Name] = '" & UserName & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
If e.Form.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
_UserRole = dr("Role")
_UserPassWord = e.Form.Controls("PassWord").Value
e.Form.Close()
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
MainTable = Tables("背景") '切换主表
forms("背景").open()