以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  求指点 处理树形表  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=193512)

--  作者:qqmss
--  发布时间:2024/9/21 19:10:00
--  求指点 处理树形表


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编辑过]

--  作者:有点蓝
--  发布时间:2024/9/22 20:13:00
--  
没看懂