如下面红色字体部分内容,设置后所有的都不可见,请教
Dim UserName As String = e.Form.Controls("UserName").Value
Dim dr As DataRow
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If User.Name <> "管理员" Then
RibbonTabs("Table").Groups("Table").Items("Query").Visible = False
Else
RibbonTabs("Table").Groups("Table").Items("Query").Visible = True
End If
dr = _UserTable.SQLFind("[Name] = '" & UserName & "'")
If dr Is Nothing Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If e.Form.Controls("PassWord").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
'
For Each t As Table In Tables
t.Visible = True
t.AllowEdit = True
For Each c As Col In t.Cols
c.Visible = True
c.AllowEdit = True
Next
Next
For Each dc As DataRow In DataTables("授权表").Select("用户名 = '" & _username & "'" )
If dc.IsNull("列名") Then
Tables(dc("表名")).Visible = Not dc("不可见")
Tables(dc("表名")).AllowEdit = Not dc("不可编辑")
Else
Tables(dc("表名")).Cols(dc("列名")).Visible = Not dc("不可见")
Tables(dc("表名")).Cols(dc("列名")).AllowEdit = Not dc("不可编辑")
End If
Next
Tables("授权表").Visible = (_UserGroup = "管理员")