以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请大神帮忙看下加载表的表达示,哪出问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=77611)

--  作者:fjndwdx
--  发布时间:2015/11/21 18:27:00
--  请大神帮忙看下加载表的表达示,哪出问题
Select Case e.DataTableName
    Case "表A","表B","表C","表D","表E","表F"
        e.Cancel = (e.User.group = "用户")
    Case "表A","表B","表G","表D"
        e.Cancel = (e.User.group = "客户")
    Case "表A","表C","表D","表Y","表G"
        e.Cancel = (e.User.group = "管理")
End Select

--  作者:游
--  发布时间:2015/11/21 19:56:00
--  

没看明白你想干嘛

 

 

Case子句中,逗号相当于Or

 

所以除了表G会执行第二个子句,表Y会执行第三个子句,其他都执行第一个子句。

 

 

 

 

 

 


--  作者:fjndwdx
--  发布时间:2015/11/21 21:09:00
--  回复:(游)没看明白你想干嘛  Case...
 

项目事件

BeforeLoadOuterTabl

想表达:

  用户组不加载 "表A","表B","表C","表D","表E","表F"
      "客户"组不加载 "表A","表B","表G","表D"
        "管理"组不加载"表A","表C","表D","表Y","表G"
       


--  作者:大红袍
--  发布时间:2015/11/22 14:37:00
--  
那现在有什么问题?报什么错?
--  作者:fjndwdx
--  发布时间:2015/11/23 19:44:00
--  回复:(大红袍)那现在有什么问题?报什么错?
出现的问题是:用户组和客户组只不加载部份表,而管理组所有表都加载了
--  作者:大红袍
--  发布时间:2015/11/23 20:27:00
--  
Select Case e.user.Group
    Case "用户"
        Select Case e.DataTableName
            Case "表A","表B","表C","表D","表E","表F"
                e.Cancel = True
        End Select
    Case "客户"
        Select Case e.DataTableName
            Case "表A","表B","表G","表D"
                e.Cancel = True
        End Select
    Case "管理"
        Select Case e.DataTableName
            Case "表A","表C","表D","表Y","表G"
                e.Cancel = true
        End Select
End Select

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

或者这样写

 

Select Case e.DataTableName
    Case "表A","表B","表C","表D","表E","表F"
        e.Cancel = (e.User.group = "用户")
End Select
Select Case e.DataTableName
    Case "表A","表B","表G","表D"
        e.Cancel = (e.User.group = "客户")
End Select
Select Case e.DataTableName
    Case "表A","表C","表D","表Y","表G"
        e.Cancel = (e.User.group = "管理")
End Select