老师,下面红字部分应该如何处理,谢谢!
Dim tbl As Table = Tables(e.Form.Name & "_Table_对外采购")
Dim tbx_加载树对外采购 As WinForm.TextBox = e.Form.Controls("TextBox_加载树对外采购")
Dim nms As String() = tbx_加载树对外采购.Text.Split(",") '指定生成目录树的各列
Dim qts As String() '将各列的值括起来的符号数组,会从fh集合中引入
Dim fh As New List(Of String) '将各列的值括起来的符号集合,字符与日期用单引号,数值不用符号,逻辑型怎么办啊
Dim jh As New List(of String)
jh.AddRange(nms) '将数组中的元素全部加入到集合中
For Each nm As String In jh
If tbl.Cols(nm).IsString OrElse tbl.Cols(nm).IsDate Then
fh.Add("'")
ElseIf tbl.Cols(nm).IsNumeric Then
fh.Add("")
Else If tbl.Cols(nm).IsBoolean Then
fh.Add("")
End If
Next
qts = fh.ToArray() '集合转数组
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
Dim flt1 As String = "类型 = '采购'"
Dim nd As WinForm.TreeNode
For Each nd In e.node.allNodes '清除子节点的选中标记
nd.Checked = False
Next
nd = e.Node.ParentNode
Do While nd IsNot Nothing '清除父节点的选中标记
nd.Checked = False
nd = nd.ParentNode
Loop
For Each nd In trv.AllNodes
If nd.Checked Then
Dim rts() As String = nd.FullPath.Split("\")
Dim val As String = ""
For i As Integer = 0 To rts.length - 1
If val > "" Then
val = val & " And "
End If
val = val & nms(i) & " = " & qts(i) & rts(i) & qts(i)
Next
If flt > "" Then
flt = flt & " Or (" & val & ")"
Else
flt = val
End If
End If
Next
If flt = Nothing Then
flt = "[编号] Is Null"
Else
flt = flt1 & " And (" & flt & ")"
End If
Dim dt As DataTable = DataTables(e.Form.Name & "_Table_对外采购")
With dt
.LoadFilter = flt '设置加载条件
.LoadPage = 0 '加载第一页
.LoadTop = 2 '每页加载的行数
.LoadOver = "编号" '加载分页字段
.Load()
e.Form.Controls("TextBox1").Value = 1 & "/" & .TotalPages
End With