以文本方式查看主题

-  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=74550)

--  作者:乡里出城
--  发布时间:2015/9/13 23:19:00
--  [求助]关于授权表的无法隐藏不可见的表
在项目属性里,如果对标题采用靠左的话(如图红圈),参考帮助项目的授权表的代码,假如某用户不可见AA表,该用户在标题上是无法显示AA表(如图蓝圈),但在左下角的三角形里(如图黄圈),只要点击三角形就会看到AA表,请问怎么才能解决无法在在三解形里显示这个AA表。

图片点击可在新窗口打开查看此主题相关图片如下:q3.png
图片点击可在新窗口打开查看


--  作者:大红袍
--  发布时间:2015/9/14 9:38:00
--  

Dim tab = basemainform.controls("mainpages")
vars("表C") = tab.tabpages("表C")
tab.tabpages.Remove(tab.tabpages("表C"))


\'----------还原

 

\'tab.tabpages.add(vars("表C"))


--  作者:乡里出城
--  发布时间:2015/9/14 11:22:00
--  
什么意思,怎么应用,我还真不懂,执行了这个代码,结果把授权表都显示出来了
[此贴子已经被作者于2015/9/14 11:24:07编辑过]

--  作者:大红袍
--  发布时间:2015/9/14 11:23:00
--  

汗,想隐藏哪个就运行代码啊

 

Dim tab = basemainform.controls("mainpages")
vars("表C") = tab.tabpages("表C")
tab.tabpages.Remove(tab.tabpages("表C"))


--  作者:乡里出城
--  发布时间:2015/9/14 11:27: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
    Return
End If
For Each dr As DataRow In DataTables("授权表").Select("用户名 = \'" & User.Name & "\'" )
    If dr.IsNull("列名") Then
        For Each t As Table In Tables
            If t.DataTable.Name = dr("表名") Then
                t.Visible = Not dr("不可见")
                t.AllowEdit = Not dr("不可编辑")
            End If
        Next
    Else
        For Each t As Table In Tables
            If t.DataTable.Name = dr("表名") Then
                For Each c As Col In t.Cols
                    If c.Name = dr("列名") Then
                        c.Visible = Not dr("不可见")
                        c.AllowEdit = Not dr("不可编辑")
                    End If
                Next
            End If
        Next
    End If
Next

请教应该怎么改,关键是已经发布的客户端使用啊,客户端不可能执行你那个代码吧

--  作者:大红袍
--  发布时间:2015/9/14 11:45: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
    Return
End If

Dim tab = basemainform.controls("mainpages")

For Each dr As DataRow In DataTables("授权表").Select("用户名 = \'" & User.Name & "\'" )
    If dr.IsNull("列名") Then
        For Each t As Table In Tables
            If t.DataTable.Name = dr("表名") Then
                if dr("不可见") = true then
                    tab.tabpages.Remove(tab.tabpages(t.name))
                End If

                t.Visible = Not dr("不可见")
                t.AllowEdit = Not dr("不可编辑")
            End If
        Next
    Else
        For Each t As Table In Tables
            If t.DataTable.Name = dr("表名") Then
                For Each c As Col In t.Cols
                    If c.Name = dr("列名") Then
                        c.Visible = Not dr("不可见")
                        c.AllowEdit = Not dr("不可编辑")
                    End If
                Next
            End If
        Next
    End If
Next


--  作者:乡里出城
--  发布时间:2015/9/14 11:50:00
--  
水平低,脑子还不灵活,谢谢了,OK了,只有多点通过案例多动手才能提升
[此贴子已经被作者于2015/9/14 11:51:32编辑过]

--  作者:乡里出城
--  发布时间:2015/9/14 14:13:00
--  
还是不行,出现这个问题,而且标题那里显示了很多本应不可见的表

图片点击可在新窗口打开查看此主题相关图片如下:11.png
图片点击可在新窗口打开查看


--  作者:大红袍
--  发布时间:2015/9/14 14:34:00
--  

If dr("不可见") = True Then
    If tab.tabpages(t.name) IsNot Nothing      
       
        tab.tabpages.Remove(tab.tabpages(t.name))
       
    End If
End If