以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  目录树选择问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=56693)

--  作者:wjliu
--  发布时间:2014/9/10 20:22:00
--  目录树选择问题
请教老师 ,帮忙看看代码哪里错了
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.table


--  作者:有点甜
--  发布时间:2014/9/10 20:41:00
--  

Dim t As Table = Tables("表a")

If e.node.Level > 0 Then
    Dim filter As String = ""
    Dim dr As DataRow = e.Node.DataRow
    If dr("分组") = "按分组" Then
        If e.Node.Level = 1 Then
            filter = "省 = \'" & dr("省") & "\'"
        Else If e.Node.Level = 2 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\'"
        Else If e.Node.Level = 3 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\'"
        Else If e.Node.Level = 4 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\' and 乡镇 = \'" & dr("乡镇") & "\'"
        Else If e.Node.Level = 5 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\' and 乡镇 = \'" & dr("乡镇") & "\' and 街道居委 = \'" & dr("街道居委") & "\'"
        End If
        filter = "客户分组 in (\'" & DataTables("客户分组").GetComboListString("街道居委", filter).Replace("|", "\',\'") & "\')"
        t.Filter = filter
       
    Else If dr("分组") = "按等级" Then
        filter = "客户等级 = \'" & dr("省") & "\'"
        t.Filter = filter
    End If
End If


--  作者:wjliu
--  发布时间:2014/9/11 8:47:00
--  
请教老师 上述代码还有个小小的缺憾就是 我在目录树中选中按分组(或按等级)是不会显示全部客户信息 请问该如何加代码 另外我想在每个节点后面显示统计信息  例如:在按等级下的a节点 在A后面显示等级是a的客户统计数
--  作者:有点甜
--  发布时间:2014/9/11 9:26:00
--  

Dim t As Table = Tables("表a")
Dim dr As DataRow = e.Node.DataRow

If e.node.Level =0 Then
    t.Filter = ""
    e.Node.Text = dr("分组") & "(" & t.Rows.Count & ")"
Else
    Dim filter As String = ""   
    If dr("分组") = "按分组" Then
        If e.Node.Level = 1 Then
            filter = "省 = \'" & dr("省") & "\'"
        Else If e.Node.Level = 2 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\'"
        Else If e.Node.Level = 3 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\'"
        Else If e.Node.Level = 4 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\' and 乡镇 = \'" & dr("乡镇") & "\'"
        Else If e.Node.Level = 5 Then
            filter = "省 = \'" & dr("省") & "\' and 市 = \'" & dr("市") & "\' and 区县 = \'" & dr("区县") & "\' and 乡镇 = \'" & dr("乡镇") & "\' and 街道居委 = \'" & dr("街道居委") & "\'"
        End If
        filter = "客户分组 in (\'" & DataTables("客户分组").GetComboListString("街道居委", filter).Replace("|", "\',\'") & "\')"
        t.Filter = filter
       
    Else If dr("分组") = "按等级" Then
        filter = "客户等级 = \'" & dr("省") & "\'"
        t.Filter = filter
    End If
    Dim idx As Integer = e.Node.Text.IndexOf("(")
    If idx > -1 Then
        e.Node.Text = e.Node.Text.SubString(0, idx) & "(" & t.Rows.Count & ")"
    Else
        e.Node.Text = e.Node.Text & "(" & t.Rows.Count & ")"
    End If
End If