老师,下面代码我是把原来的用户组改为用户角色,然后提示错误:编译错误,未声名:UserIsRoleEnum,错误代码:Tables("sqb").Visible = (User.Type <> UserIsRoleEnum.User ),关于用户角色的使用,总是用不好,下面的代码该怎么改修呢?请老师指导,谢谢!!
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("sqb").Visible = (User.Type <> UserIsRoleEnum.User )
If User.Type = UserIsRoleEnum.User Then
For Each dr As DataRow In DataTables("sqb").Select("用户角色 = '" & User.IsRole & "'" )
If dr.IsNull("列名") Then
Tables(dr("表名")).Visible = Not dr("不可见")
Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
Else
Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
End If
Next
End If
[此贴子已经被作者于2020/4/24 15:21:40编辑过]