chanpin:
Select Case e.DataCol.Name
Case "shuliang"
Dim fl as string = "chanpinid = " & e.DataRow("_Identify")
Dim n1,n2 As Double
n1 = DataTables("chuhuo").Compute("sum(shuliang)",fl)
n2 = DataTables("zhidai").Compute("sum(shuliang)",fl & " and ruku = True")
e.DataRow("库存数量")=dr("shuliang")- n1+n2
End Select
chuhuo:
Select Case e.DataCol.Name
Case "shuliang"
Dim n1,n2 As Double
Dim fl as string = "chanpinid = " & e.DataRow("chanpinid")
n1 = DataTables("chuhuo").Compute("sum(shuliang)",fl)
n2 = DataTables("zhidai").Compute("sum(shuliang)",fl & " and ruku = True")
Dim dr As DataRow = e.DataRow.GetParentrow("chanpin")
if dr isnot nothing then
dr("库存数量")=dr("shuliang")- n1+n2
end if
End Select
ZHIDAI:
Select Case e.DataCol.Name
Case "shuliang","ruku"
Dim n1,n2 As Double
Dim fl As String = "chanpinid = " & e.DataRow("chanpinid")
n1 = DataTables("chuhuo").Compute("sum(shuliang)",fl)
n2= DataTables("zhidai").Compute("sum(shuliang)",fl & " and ruku = True")
Dim dr As DataRow = e.DataRow.GetParentrow("chanpin")
If dr IsNot Nothing Then
dr("库存数量")=dr("shuliang")- n1+n2
End If
End Select