Select Case e.DataCol.name
Case "产品编号"
Dim dr As DataRow = DataTables("表达式库存A").Find("产品编号 = '" & e.OldValue & "'")
If dr Is Nothing Then
dr = DataTables("表达式库存A").AddNew()
dr("产品类别") = e.DataRow("产品类别")
dr("次类") = e.DataRow("次类")
dr("产品编号") = e.DataRow("产品编号")
dr("品名") = e.DataRow("品名")
dr("别名") = e.DataRow("别名")
dr("规格") = e.DataRow("规格")
dr("单位") = e.DataRow("单位")
dr("库存上限") = e.DataRow("库存上限")
dr("库存下限") = e.DataRow("库存下限")
Else
dr("产品编号") = e.DataRow("产品编号")
End If
'Case "产品名称","规格型号"
Case "品名","规格"
Dim dr As DataRow = DataTables("表达式库存A").Find("产品编号 = '" & e.DataRow("产品编号") & "'")
If dr IsNot Nothing Then
dr(e.DataCol.Name) = e.DataRow(e.DataCol.Name)
End If
End Select
Dim dr As DataRow = DataTables("表达式库存A").Find("产品编号 = '" & e.DataRow("产品编号") & "'")
If dr IsNot Nothing Then
dr.Delete()
End If
用方法一:出现问题这个只显示:"产品类别","次类","产品编号","品名","规格",其他字段显示不了。
方法二:
If e.DataCol.Name = "有效状态" AndAlso e.DataRow("有效状态") = True Then
Dim nma() As String = {"产品类别","次类","产品编号","品名","别名","规格","单位","库存上限","库存下限"}
Dim nmb() As String = {"产品类别","次类","产品编号","品名","别名","规格","单位","库存上限","库存下限"}
Dim dr As DataRow = DataTables("表达式库存A").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
用方法二:也有问题,只显示"产品类别","次类","产品编号","品名","别名","规格","单位"的数据,"库存上限","库存下限"的数据显示不了,不知道怎么问题