这个暂时不管它 我想请您帮个忙看看 这个情况是什么原因 目录树:
Dim Filter As String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.Text <> "所有订单" Then
Select Case e.Node.Level
Case 0
Filter = "[车牌] = '" & dr("车牌") & "'"
Case 1
Filter = "[车牌] = '" & dr("车牌") & "' And [司机] = '" & dr("司机") & "'"
Case 2
Filter = "[车牌] = '" & dr("车牌") & "' And [司机] = '" & dr("司机") & "' And [项目] = '" & dr("项目") & "'"
End Select
End If
Tables("配载订单").Filter = Filter
afterLoad :
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("配载订单", "车牌|司机|项目")
trv.Nodes.Insert("所有订单",0)
有时候一级目录是司机 有时候是车牌 为什么不稳定
另外我在刷新按钮加了时间选择
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
If cpbh = "" Then
DataTables("配载订单").LoadFilter=" [出车日期] >= #" & sd.Value & "# and [出车日期] <= #" & ed.Value & "#"
DataTables("配载订单").Load
Else
DataTables("配载订单").LoadFilter=" [出车日期] >= #" & sd.Value & "# and [出车日期] <= #" & ed.Value & "# and [项目] like '%" & cpbh & "%' "
DataTables("配载订单").Load
End If
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("配载订单", "司机|项目|客户")
trv.Nodes.Insert("所有订单",0)
我还想这样的:
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
If sd and ed is null then
messagebox.show("请选定日期再刷新")
elseIf cpbh = "" Then
DataTables("配载订单").LoadFilter=" [出车日期] >= #" & sd.Value & "# and [出车日期] <= #" & ed.Value & "#"
DataTables("配载订单").Load
Else
DataTables("配载订单").LoadFilter=" [出车日期] >= #" & sd.Value & "# and [出车日期] <= #" & ed.Value & "# and [项目] like '%" & cpbh & "%' "
DataTables("配载订单").Load
End If
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("配载订单", "司机|项目|客户")
trv.Nodes.Insert("所有订单",0)
报错 要怎样改