以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  导航栏窗口是否和可视化授权的代码有矛盾?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=34400)

--  作者:阿标
--  发布时间:2013/6/7 0:49:00
--  导航栏窗口是否和可视化授权的代码有矛盾?

求教!!!

 

我用了可视化授权的方式(按组)授权,代码为

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
For Each dr As DataRow In DataTables("授权表").Select("用户分组 = \'" & User.Group & "\'" )
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
同时我用导航栏窗口:

TopicLinkClick

代码为:Select Case e.link.Text
    Case "授权表"
        MainTable = Tables("授权表")
    Case "基本信息"
        MainTable = Tables("基本信息")
    Case "职工人事档案"
        MainTable = Tables("职工人事档案")
    Case "即时数据汇总"
        MainTable = Tables("即时数据汇总")
    Case "安全综合管理"
        MainTable = Tables("安全综合管理")
等等
End Select

TopicPageExpanded

代码为:
Dim tpb As WinForm.TopicBar = e.Form.Controls("TopicBar1")
For Each page As WinForm.TopicPage In tpb.Pages
    If page.Name <> e.Page.Name Then
        page.Collapsed = True
    End If
Next
授权表,Users表,等按说明进行编写,但在内部表时授权有作用,而用外部表时并且不用导航栏时也有作用;但一用导航栏,不管是谁都可从导航栏窗口进行查看和编辑!!!????
--  作者:狐狸爸爸
--  发布时间:2013/6/7 8:54:00
--  

代码是灵活的,例如:

 

Case "授权表"
        MainTable = Tables("授权表")

改为:

 

Case "授权表"

        If Tables("授权表").Visible Then
              MainTable = Tables("授权表")

        Else

              MessageBox.show("你无权打开此表")

        End If