Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim rts() As String = {"全部","资产","负债","共同","权益","成本","损益"}
Dim nd As WinForm.TreeNode
Dim dt As DataTable = DataTables("科目")
tr.StopRedraw()
tr.Nodes.Clear
For Each rt As String In rts
tr.Nodes.Add(rt)
Next
For Each dr As DataRow In dt.Select("", "科目代码")
If dr.IsNull("科目代码") = False AndAlso dr("科目代码").Length = 4 Then
Dim i As Integer = CInt(dr("科目代码").Substring(0,1))
nd = tr.Nodes(i).Nodes.Add(dr("科目代码"),dr("科目代码") & " " & dr("科目名称"))
Functions.Execute("AddChildren",nd,dt)
End If
Next
tr.ResumeRedraw()
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd As WinForm.TreeNode
Dim dt As DataTable = DataTables("科目")
tr.StopRedraw()
tr.Nodes.Clear
tr.Nodes.Add("全部")
For Each dr As DataRow In dt.Select("","科目代码")
If dr.IsNull("科目代码") = False AndAlso dr("科目代码").Length = 4 Then
nd = tr.Nodes.Add(dr("科目代码"),dr("科目代码") & " " & dr("科目名称"))
Functions.Execute("AddChildren",nd,dt)
End If
Next
tr.ResumeRedraw()