Dim drs As List(of DataRow)=DataTables("销售查询").Select("[客户编码]='" & e.DataRow("客户编码") &"' And [产品编码]='" & e.dataRow("产品编码") &"'","出货日期 desc")
If drs.count>0
Dim Cols1() As String = {"出货日期","包装规格","出货方式","出货数量","包装单位","出货单价"}
Dim Cols2() As String = {"出货日期","包装规格","出货方式","出货数量","包装单位","出货单价"}
For i as integer = 0 to math.min(drs.count - 1,4)
dim dr1 as datarow = drs(i)
Dim dr2 As Row = Tables("预售单_table10").AddNew()
For i As Integer = 0 To Cols1.Length -1
dr2(Cols2(i)) = dr1(Cols1(i))
Next
Next
Tables("预售单_table10").sort="出货日期 DESC"
End If