还是没有办法,请有点蓝老师继续指导!谢谢!!
以下是在LoadUserSetting中的代码,但我找不到问题出在哪儿,总是达不到设置权限的效果。
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 )
If User.Type <> UserTypeEnum.User Then
Return
End If
For Each dr As DataRow In DataTables("授权").Select("UserName = '" & _UserName & "'" )
If dr.IsNull("ColName") Then
For Each t As Table In Tables
If t.DataTable.Name = dr("DateName") Then
t.Visible = Not dr("NoShow")
t.AllowEdit = Not dr("NoEdit")
End If
Next
Else
For Each t As Table In Tables
If t.DataTable.Name = dr("DateName") Then
For Each c As Col In t.Cols
If c.Name = dr("ColName") Then
c.Visible = Not dr("Noshow")
c.AllowEdit = Not dr("Noedit")
End If
Next
End If
Next
End If
Next