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