Select Case e.DataCol.Name
Case "合格品","不合格品"
Dim pr As DataRow
pr = DataTables("生产排产表").Find("加工工序 = '" & e.DataRow("加工工序") & "' and 成品编码 = '" & e.DataRow("成品编码")& "' and 生产批次 = '" & e.DataRow("生产批次") & "'")
If pr IsNot Nothing Then
pr(e.DataCol.Name)= e.DataTable.Compute("sum(" & e.DataCol.Name & ")", "加工工序 = '" & e.DataRow("加工工序") & "' and 成品编码 = '" & e.DataRow("成品编码") & "' and 生产批次 = '" & e.DataRow("生产批次")& "' and _Identify <> " & e.DataRow("_Identify")) + e.DataRow(e.DataCol.Name)
End If
End Select