如下代码。
If User.Type = UserTypeEnum.Developer Then
For Each t As Table In Tables
t.Visible = True
t.AllowEdit = True
Next
End If
Forms("窗口1").open
Forms("窗口1").visible=False
Forms("窗口2").open
Forms("窗口2").visible=False
If User.Type = UserTypeEnum.User Then
For Each t As Table In Tables
If t.Name.Contains("_") Then
Dim ary() As String = t.Name.Split("_")
Dim fdr As DataRow = DataTables("权限管理").Find("用户名 = '" & User.Name & "' and 窗口 = '" & ary(0) & "' and 表名 = '" & ary(1) & "'")
If fdr IsNot Nothing Then
t.AllowEdit = fdr("可编辑")
Else
t.AllowEdit = False
End If
End If
t.AllowEdit = False
Dim dr As DataRow = DataTables("权限管理").Find("用户名 = '" & user.Name & "' and 表名 = '" & t.Name & "'")
If dr IsNot Nothing Then
t.AllowEdit = dr("可编辑")
Else
t.AllowEdit = False
End If
Next
End If