Foxtable(狐表)用户栏目专家坐堂 → 求指点 处理树形表


  共有135人关注过本帖树形打印复制链接

主题:求指点 处理树形表

帅哥哟,离线,有人找我吗?
qqmss
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:14 积分:145 威望:0 精华:0 注册:2024/9/12 8:51:00
求指点 处理树形表  发帖心情 Post By: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楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109676 积分:558072 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/9/22 20:13:00 [只看该作者]

没看懂

 回到顶部