If e.DataCol.Name = "数量" Then If e.DataRow.Isnull("数量") = False Dim n As Integer = e.DataRow("数量") Dim nma() As String = {"入库单号","名称","规格"} Dim nmb() As String = {"入库单号","名称","规格"} dim drlist as List(of datarow) = DataTables("固定资产库存").select("入库单号='" & e.datarow("入库单号") & "'")
if drlist is nothing then
for i as integer = 1 to n then
Dim dr As DataRow = DataTables("固定资产库存").AddNew()
For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next next
else
if drlist.count>n then
for i as integer=0 to drlist.count-n-1
drlist(i).Delete
next
end if
end if
End If
End If