表《返仓单》中的datacolchanged设置代码如下:
If e.DataCol.Name = "库房确认" Then
If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
Dim frs As list(Of DataRow) = DataTables("返仓明细").SQLSelect("返仓单号 = '" & e.DataRow("返仓单号") & "'")
For Each dr As DataRow In frs
dim s as string = dr("库房确认")
dr("库房确认") = "已返仓"
if s = "待返仓" then
Dim fr As DataRow = DataTables("入库明细").SQLFind("入库单号 = '" & dr("入库单号") & "'")
If fr IsNot Nothing Then
dr("供应商") = fr("供应商")
dr("入库用途") = fr("入库用途")
dr("入库分类") = fr("分类")
dr("备注") = fr("备注")
End If
end if
Next
DataTables("返仓明细").SQLUpdate(frs)
End If
end if