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


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

主题:求指点 处理树形表

帅哥哟,离线,有人找我吗?
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编辑过]

 回到顶部