以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]加载树不同用户加载不同数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=99698)

--  作者:gengwvi
--  发布时间:2017/4/25 10:24:00
--  [求助]加载树不同用户加载不同数据
老师,好
     我已经在加载表针对不同的用户权限在加载表的时候做了加载设置。 但是通过    菜单加载树   加载的时候代码不受限制,应该如何修改?

表权限写在可  loaduser -project    菜单使用,加载树  MainTable.OpenLoadTree()  

If User.Group = "销售" Then
    DataTables("合同录入系统").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("理财合同登记").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("酒会登记").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("旅游登记").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("收款收据").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("我的意向客户").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("我的客户").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("业务员信息表").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("邮件打印").LoadFilter = "业务员 = \'" & User.name & "\'"
    DataTables("信封打印系统").LoadFilter = "业务员 = \'" & User.name & "\'"
ElseIf User.Group = "团队长" Then
    Dim names As String = DataTables("业务员信息表").GetComboListString("姓名", "团队 = \'" & user.name & "\'")
    DataTables("合同录入系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("理财合同登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("酒会登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("旅游登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("收款收据").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的意向客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("业务员信息表").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("邮件打印").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("信封打印系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
ElseIf User.Group = "经理" Then
    Dim names As String = DataTables("业务员信息表").GetComboListString("姓名", "部门 = \'" & user.name & "\'")
    DataTables("合同录入系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("理财合同登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("酒会登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("旅游登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("收款收据").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的意向客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("业务员信息表").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("邮件打印").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("信封打印系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
ElseIf User.Group = "总监" Then
    Dim names As String = DataTables("业务员信息表").GetComboListString("姓名", "总监 = \'" & user.name & "\'")
    DataTables("合同录入系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("理财合同登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("酒会登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("旅游登记").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("收款收据").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的意向客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("我的客户").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("业务员信息表").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("邮件打印").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
    DataTables("信封打印系统").LoadFilter = "业务员 in (\'" & names.Replace("|", "\',\'") & "\')"
ElseIf user.Type = UserTypeEnum.Administrator AndAlso user.Type = UserTypeEnum.Developer
    DataTables("合同录入系统").LoadFilter = ""
    DataTables("理财合同登记").LoadFilter = ""
    DataTables("酒会登记").LoadFilter = ""
    DataTables("旅游登记").LoadFilter = ""
    DataTables("收款收据").LoadFilter = ""
    DataTables("我的意向客户").LoadFilter = ""
    DataTables("业务员信息表").LoadFilter = ""
    DataTables("我的客户").LoadFilter = ""
    DataTables("邮件打印").LoadFilter = ""
    DataTables("信封打印系统").LoadFilter = ""
End If
DataTables("合同录入系统").Load
DataTables("理财合同登记").Load
DataTables("酒会登记").Load
DataTables("旅游登记").Load
DataTables("收款收据").Load
DataTables("我的意向客户").Load
DataTables("我的客户").load
DataTables("业务员信息表").load
DataTables("邮件打印").load
DataTables("信封打印系统").load



--  作者:有点色
--  发布时间:2017/4/25 10:29:00
--  

OpenLoadTree的话,你可以加入条件的,如

 

http://www.foxtable.com/webhelp/scr/2022.htm

 

如果要控制加载,还可以在这里写代码

 

http://www.foxtable.com/webhelp/scr/2057.htm

 

最好的话,还是自己做一个加载树吧,控制更自由

 

http://www.foxtable.com/webhelp/scr/2054.htm

 

http://www.foxtable.com/webhelp/scr/2692.htm