Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求指点 处理树形表

1楼
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编辑过]
2楼
有点蓝 发表于:2024/9/22 20:13:00
没看懂
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.