以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 多条件加载 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=139888) |
-- 作者:fendouww -- 发布时间:2019/8/24 10:50:00 -- 多条件加载 我想要在登录时加载审核过后的包含当前登录名的行和空白行 这是我写的代码 If User.Group = "设计组长" OrElse User.Group = "设计师" Then DataTables("面料调样表").LoadFilter = "设计师 = \'" & User.Name & "\'" ElseIf User.Group = "面料理单" Then DataTables("面料调样表").LoadFilter = "审核 = 1" And "面料调样员 = \'" & User.Name & "\'" Else DataTables("面料调样表").LoadFilter = "" End If |
-- 作者:有点蓝 -- 发布时间:2019/8/24 11:04:00 -- If User.Group = "设计组长" OrElse User.Group = "设计师" Then DataTables("面料调样表").LoadFilter = "设计师 = \'" & User.Name & "\'" ElseIf User.Group = "面料理单" Then DataTables("面料调样表").LoadFilter = "审核 = 1 And (面料调样员 = \'" & User.Name & "\' or 面料调样员 is null)" Else DataTables("面料调样表").LoadFilter = "" End If
|
-- 作者:fendouww -- 发布时间:2019/8/24 12:14:00 -- 多条件加载 谢谢,我在加载树那里想做到这样,是在BeforeLoad事件中写的代码,但好像 又错了 If user.group = "设计组长" Dim fl As String = "[设计师] = \'" & User.Name & "\'" If e.DataTable.LoadFilter = "" Then e.DataTable.LoadFilter = fl ElseIf user.group = "设计师" Dim fr As String = "[设计师] = \'" & User.Name & "\'" If e.DataTable.LoadFilter = "" Then e.DataTable.LoadFilter = fr ElseIf user.group = "面料理单" Dim fd As String = "[面料调样员] = \'" & User.Name & "\'" Dim fe As String = "[审核] = 1" Dim ff As String = "[面料调样员] is null" If e.DataTable.LoadFilter = "" Then e.DataTable.LoadFilter = "fe And (fd or ff)" End If End If End If End If 点加载树还是会全部 加载 |
-- 作者:有点蓝 -- 发布时间:2019/8/24 14:11:00 -- If User.Group = "设计组长" OrElse User.Group = "设计师" Dim fl As String = "[设计师] = \'" & User.Name & "\'" If e.DataTable.LoadFilter = "" OrElse Then e.DataTable.LoadFilter = fl ElseIf e.DataTable.LoadFilter.IndexOf(fl) < 0 Then \'如果没有包括雇员条件 e.DataTable.LoadFilter = e.DataTable.Loadfilter & " And " & fl End If ElseIf user.group = "面料理单" Dim fd As String = "([面料调样员] = \'" & User.Name & "\' or [面料调样员] Is null) And [审核] = 1" If e.DataTable.LoadFilter = "" Then e.DataTable.LoadFilter = fd ElseIf e.DataTable.LoadFilter.IndexOf(fd) < 0 Then \'如果没有包括雇员条件 e.DataTable.LoadFilter = e.DataTable.Loadfilter & " And " & fd End If End If
|