Dim cnt As Integer = Tables("更新数据").Rows.Count - 1
For i As Integer = 0 To cnt
Dim n1 As String = Tables("更新数据").Rows(i).DataRow("料号1")
Dim n2 As String = Tables("更新数据").Rows(i).DataRow("分群码")
Dim dr0 As DataRow
dr0 = DataTables("原始数据").Find("料号1 = '" & n1 & "' ","生产周期_天" ,0)
Dim dr1 As DataRow
dr1 = DataTables("原始数据").Find("料号1 = '" & n1 & "' ","生产周期_天" ,1)
Dim dr2 As DataRow
dr2 = DataTables("原始数据").Find("料号1 = '" & n1 & "' ","生产周期_天" ,2)
If dr0 IsNot Nothing Then
Tables("更新数据").Rows(i).DataRow("起始数量_台") = dr0.SQLGetValue("起始数量_台")
Tables("更新数据").Rows(i).DataRow("截止数量_台") = dr0.SQLGetValue("截止数量_台")
Tables("更新数据").Rows(i).DataRow("生产周期_天") = dr0.SQLGetValue("生产周期_天")
End If
Dim r As Row = Tables("更新数据").Rows(i)
For j As Integer = 1 To 2
If j = 1 Then
If dr1 IsNot Nothing Then
r.Clone
Tables("更新数据").Current("起始数量_台") = dr1.SQLGetValue("起始数量_台")
Tables("更新数据").Current("截止数量_台") = dr1.SQLGetValue("截止数量_台")
Tables("更新数据").Current("生产周期_天") = dr1.SQLGetValue("生产周期_天")
End If
Else If j = 2 Then
If dr2 IsNot Nothing Then
r.Clone
Tables("更新数据").Current("起始数量_台") = dr2.SQLGetValue("起始数量_台")
Tables("更新数据").Current("截止数量_台") = dr2.SQLGetValue("截止数量_台")
Tables("更新数据").Current("生产周期_天") = dr2.SQLGetValue("生产周期_天")
End If
End If
Next
Next