Dim e As RequestEventArgs = Args(0)
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "select * fro m 部门"
Dim dt As DataTable = cmd.ExecuteReader
dt.LoadFilter = ""
dt.Load()
Dim result As New List(Of Object)
Functions.Execute("getChildrenDept", dt, result)
------------getChildrenDept方法---
Dim dt As DataTable = Args(0)
Dim result As List(Of Object) = Args(1)
For Each dr As DataRow In dt.DataRows
Dim map As New Dictionary(Of String, Object)
map.Add("id", dr("id"))
map.Add("title", dr("bumenmingcheng"))
Dim result1 As List(Of Object)
dt.LoadFilter = " deptparentid ='" & dr("deptmyid") & "'"
dt.Load
map.add("children", Functions.Execute("getChildrenDept", dt, result1))
result.add(map)
Next
Return result
[此贴子已经被作者于2024/9/21 19:29:33编辑过]