Select Case e.DataCol.Name
Case "车间名称","工序明细","产品图号","包括装配组件每台用量"
If e.DataRow.IsNull("车间名称") Then
e.DataRow("工时明细") = Nothing
Else
Dim filter As String = "产品图号 = '" & e.DataRow("产品图号") & "'"
Dim fdr As DataRow = DataTables("工时统计表").Find(filter)
Dim sum As Double = 0
Dim str As String = ""
If fdr IsNot Nothing Then
For Each dc As DataCol In DataTables("工时统计表").DataCols
If dc.Name.StartsWith("工序_") AndAlso fdr(dc.name) > 0 Then
Dim dr As DataRow = DataTables("工序明细").Find("车间 = '" & e.DataRow("车间名称") & "' and 工序列名称 = '" & dc.Name & "'")
If dr IsNot Nothing Then
str &= dr("工序名称") & ","
sum += fdr(dc.name)
End If
End If
Next
End If
e.DataRow("工序明细") = str.trim(",")
e.DataRow("工时明细") = sum
End If
End Select
如果由 “产品图号 包括装配组件每台用量” 这两列控制(这两列都是工时统计表的列名)
代码该如何修改?
试了几种都不行
求大神指教