以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  文本分割  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=78184)

--  作者:sf020cf
--  发布时间:2015/12/3 16:27:00
--  文本分割

现有一刷新代码为:

Dim sd As WinForm.DateTimePicker
Dim ed As WinForm.DateTimePicker
sd = e.Form.Controls("DateTimePicker1")
ed = e.Form.Controls("DateTimePicker2")
Dim cpbh As String = e.Form.Controls("项目").Value

Dim filter As String = "1=1"
If sd.Value <> Nothing Then
    filter &= " And 出车日期 >= \'" & sd.value & "\'"
End If
If ed.Value <> Nothing Then
    filter &= " And 出车日期 <= \'" & ed.value & "\'"
End If
If cpbh <> "" Then
    filter &= " And [项目] Like \'%" & cpbh & "%\' "
End If
If ed.value = Nothing AndAlso sd.value = Nothing Then
    filter &= " And 出车日期 = \'" & Date.today & "\'"
End If
DataTables("配载订单").LoadFilter=filter
DataTables("配载订单").Load
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("配载订单", "车牌|司机|项目")
trv.Nodes.Insert("所有订单",0)

 

在"项目"文本框中 输入项目(默认一个项目)怎样才能输入多个项目 并且刷新时能识别 类似 包道/麦德龙/三星   能识别是三个项目


--  作者:大红袍
--  发布时间:2015/12/3 16:30:00
--  
If cpbh <> "" Then
    Dim temp As String = "1=2"
    For Each s As String In cpbh.split("/")
        temp &= " or [项目] Like \'%" & s & "%\' "
    Next
    filter &= " And (" & temp & ")"
End If