Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "物料系数"
If dr.IsNull("物料系数") = False And dr.IsNull("加工级别") = False And dr.IsNull("组件序号") = False Then
If dr("加工级别") = 1 Then
dr("系数统计") = dr("物料系数")
Else
Dim ab As Byte = dr("加工级别") - 1
Dim dr2,dr3,dr4 As DataRow
Dim idx As Integer = dr("组件序号").LastIndexOf(".")
Dim pstr As String = ""
If idx > -1 Then pstr = dr("组件序号").SubString(0, idx)
Dim Filter As String = "组件序号 like '" & pstr & "%' and 加工级别 = '" & ab & "' "
dr2 = DataTables("表A").find(Filter, "组件序号")
If dr2 Is Nothing Then
dr("系数统计") = dr("物料系数")
Else
dr("系数统计") = dr("物料系数") * dr2("系数统计")
End If
End If
End If
End Select