Foxtable(狐表)用户栏目专家坐堂 → [求助]计算目录树各节点数据


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

主题:[求助]计算目录树各节点数据

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2015/11/21 10:03:00 [显示全部帖子]

mlsjs函数

 

Dim ys As String = Args(0)
Dim drow As DataRow = Args(1)
Dim zl As Double = 0
Dim dr As DataRow
Dim drs As List(of DataRow)
drs = drow.DataTable.Select("[隶属] = '" & ys & "'")
If drs.Count = 0 Then
    If drow.IsNull("单重") = False Then
        zl = drow("单重") * drow("隶属数量")
    End If
Else
    For Each dr In drs
        zl += Functions.Execute("mlsjs", drow("元素"),dr)
    Next
End If

Return zl

 

 

按钮事件

 

Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
tr.CreateTree("表A","绝对路径")

For Each nd As WinForm.TreeNode In tr.AllNodes
    Dim zl = Functions.Execute("mlsjs",nd.DataRow("元素") ,nd.DataRow)
    nd.Text = nd.DataRow("复合名称") & "数量(" & nd.DataRow("隶属数量") & ")" & "重量(" & zl & ")"
Next
tr.ExpandAll


 回到顶部