Foxtable(狐表)用户栏目专家坐堂 → 导航栏窗口是否和可视化授权的代码有矛盾?


  共有4836人关注过本帖树形打印复制链接

主题:导航栏窗口是否和可视化授权的代码有矛盾?

帅哥哟,离线,有人找我吗?
阿标
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:53 积分:821 威望:0 精华:0 注册:2013/1/10 10:35:00
导航栏窗口是否和可视化授权的代码有矛盾?  发帖心情 Post By: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表,等按说明进行编写,但在内部表时授权有作用,而用外部表时并且不用导航栏时也有作用;但一用导航栏,不管是谁都可从导航栏窗口进行查看和编辑!!!????

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/7 8:54:00 [只看该作者]

代码是灵活的,例如:

 

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

改为:

 

Case "授权表"

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

        Else

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

        End If


 回到顶部