Dim r As Row = Tables("订单产品资料").Current
Dim dnew As Row = Tables("订单产品资料").AddNew
Dim name As String = r("PNum") & "_复件"
For Each c As Col In Tables("订单产品资料").Cols
If c.Name = "PNum" Then
dnew(c.Name) = name
ElseIf c.Name <> "_Identify" Then
dnew("Product") = r("Product")
dnew("PCount") = r("PCount")
dnew("CalUnit") = r("CalUnit")
dnew("InDate") = r("InDate")
dnew("Des") = r("Des")
dnew("OrderNum") = r("OrderNum")
dnew("ProductType") = r("ProductType")
dnew("Price") = r("Price")
dnew("ContractNum") = r("ContractNum")
dnew("SumPrice") = r("SumPrice")
dnew("BKY") = r("BKY")
dnew("Customer") = r("Customer")
dnew("Sales") = r("Sales")
dnew("Maker") = r("Maker")
dnew("PType") = r("PType")
End If
Next
Dim drs As List(Of DataRow)
drs = r.DataRow.GetChildRows("明细1")
Dim rc As DataRow
For Each dr As DataRow In drs
rc = dr.Clone
rc("IDD") = dnew("IDD")
Next
Dim dr1s As List(Of DataRow)
dr1s = r.DataRow.GetChildRows("明细2")
Dim rc1 As DataRow
For Each dr1 As DataRow In dr1s
rc1 = dr1.Clone
rc1("IDD") = dnew("IDD")
Next
Dim dr2s As List(Of DataRow)
dr2s = r.DataRow.GetChildRows("明细3")
Dim rc2 As DataRow
For Each dr2 As DataRow In dr2s
rc2 = dr2.Clone
rc2("IDD") = dnew("IDD")
Next