Select Case e.DataCol.Name
Case "日期"
If e.DataRow.IsNull("日期") Then
e.DataRow("产品数量")= Nothing
e.DataRow("重量")= Nothing
e.DataRow("PP黑料用量")= Nothing
e.DataRow("PP新料")= Nothing
Else
Dim dr As DataRow = DataTables("产品用料表").Find("产品编码='" & e.DataRow("产品编码") & "' and 型号='" & e.DataRow("型号") & "'")
If dr IsNot Nothing Then
Dim sl As Integer = DataTables("联塑订单表").Compute("Sum(数量)","下单日期='" & e.DataRow("日期") & "' And 产品编码='" & e.DataRow("产品编码") & "' and 型号='" & e.DataRow("型号") & "'")
e.DataRow("产品数量")= sl
e.DataRow("重量")= dr("重量") * sl
e.DataRow("PP黑料用量")= dr("PP黑料用量") * sl
e.DataRow("PP新料")= dr("PP新料") * sl
End If
End If
End Select