Select Case每个Case不能重叠的,否则后面的不执行!
Dim dr As DataRow = e.DataRow
Dim Filter As String = "[产品ID] = '" & dr("产品ID") & "'"
Select Case e.DataCol.Name
Case "规格"
If dr.IsNull("规格") Then
dr("规格转换") = Nothing
Else
dr("规格转换") = eval(dr("规格")) / 10000
End If
End Select
Select Case e.DataCol.Name
Case "针数","专数","针种"
If dr.IsNull("针数") Or dr.IsNull("专数") Or dr.IsNull("针种") Then
dr("挡车基数") = Nothing
Else
dr("挡车基数") = dr("针数") / dr("针种") * dr("专数")
End If
Case "挡车基数"
DataTables("生产明细").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)
DataTables("改码记录").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)
DataTables("生产明细").Save()
DataTables("改码记录").Save()
Case "订单ID","客户","款号","颜色","缸号","品名","尺码","规格"
DataTables("生产排单").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)
DataTables("改码记录").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)
DataTables("生产排单").Save()
DataTables("改码记录").Save()
Case "产品单价"
DataTables("出货明细").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)
DataTables("出货明细").Save()
End Select