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
Tables("权限表").Visible = (User.Type <> UserTypeEnum.User )
Dim j As String = _Userrole.trim()
For Each dr As DataRow In DataTables("权限表").Select("[角色] like \'*" & j & "*\'" )
Dim lm As String = dr("列名")
Dim Values() As String
Values = lm.split(",")
For Each l As String In values
If dr.IsNull("列名") Then
For Each t As Table In Tables
If t.DataTable.Name = dr("表名") Then
t.Visible = Not dr("不可见")
t.AllowEdit = Not dr("不可编辑")
End If
Next
Else
For Each t As Table In Tables
If t.DataTable.Name = dr("表名") Then
For Each c As Col In t.Cols
If c.Name = l Then
c.Visible = Not dr("不可见")
c.AllowEdit = Not dr("不可编辑")
End If
Next
End If
Next
End If
Next
Next