AddChildren函数
Dim pdr As DataRow = args(0)
Dim dt As DataTable = args(1)
Dim cardnum As String = args(2)
Dim idx As Integer = args(3)
Dim dr As DataRow = dt.Find("卡号 = '" & cardnum & "'")
If dr IsNot Nothing Then
Select Case idx
Case 1
pdr("一级推荐人卡号") = pdr("推荐人卡号")
Functions.Execute("AddChildren",pdr ,dt, pdr("推荐人卡号"),idx+1)
Case 2
pdr("二级推荐人卡号") = dr("推荐人卡号")
Functions.Execute("AddChildren",pdr ,dt, dr("推荐人卡号"),idx+1)
Case 3
pdr("三级推荐人卡号") = dr("推荐人卡号")
End Select
End If
调用
Dim dr As DataRow = CurrentTable.Current.DataRow
Functions.Execute("AddChildren",dr,CurrentTable.DataTable,dr("推荐人卡号"),1)