Dim t As Table = e.Form.Controls("Table1").Table
Dim r1 As Row
Dim Names As New List(Of String)
For i As Integer = t.TopPosition To t.BottomPosition
r1 = t.Rows(i)
If Names.Contains(r1("行编码")) = False Then
Names.Add(r1("行编码"))
Dim dr As DataRow = DataTables("出入库明细表").Find("行编码='" & r1("行编码") & "'")
MsgBox("i=" & i & ",find=" & (dr IsNot Nothing))
If dr IsNot Nothing Then
Dim sr As DataRow
sr = DataTables("政策备案明细表").sqlFind("[供应商内码] = '" & r1("供应商内码") & "' And [渠道商内码] = '" & r1("渠道商内码") & "' And [品种内码] = '" & r1("品种内码") & "'And [销售单位内码] = '" & r1("销售单位内码") & "'", "制单日期 Desc") '在后台查找符合条件的行
MsgBox("sr=" & (sr IsNot Nothing))
If sr IsNot Nothing Then '如果找到了符合条件的行
dr("渠道商返利单价") = sr("渠道商返利单价")
dr.save
End If
End If
End If
Next