--
If e.DataCol.name = "数量个"
\'自动给(出入库)输入数据
Dim dr22 As DataRow
dr22 = DataTables("销售报价").Find("产品代号 = \'" & e.DataRow("产品型号") & "\' And 客户简称 = \'" & "施耐德广州" & "\'")
Dim jkdh As String = e.DataRow("送货单号") & "-ZZJK"
Dim dr1 As DataRow = DataTables("出入库").Find("出入库单号 = \'" & jkdh & "\' and 物料编号 = \'" & e.DataRow("产品型号") & "\'")
If dr1 IsNot Nothing Then
dr1("入库数量") = dr1("入库数量") + e.newvalue - e.oldvalue
\'下面这段不起作用
If dr1("入库数量") = 0
dr1("录入员核对") = False
dr1.delete
End If
Else
Dim dr3 As DataRow = DataTables("出入库").AddNew()
dr3("出入库单号") = jkdh
dr3("出入库日期") = e.DataRow("送货日期")
dr3("出入原因") = "入库-生产入库"
dr3("部供客简称") = "组装车间"
dr3("物料编号") = e.DataRow("产品型号")
dr3("入库数量") = e.newvalue - e.oldvalue
dr3("录入员核对") = True
End If
Dim ckdh As String = e.DataRow("送货单号") & "-ZZCK"
Dim dr2 As DataRow = DataTables("出入库").Find("出入库单号 = \'" & ckdh & "\' and 物料编号 = \'" & e.DataRow("产品型号") & "\'")
If dr2 IsNot Nothing Then
dr2("出库数量") = dr2("出库数量") + (-1) * (e.newvalue - e.oldvalue)
\'下面这段不起作用
If dr2("出库数量") = 0
dr2("录入员核对") = False
dr2.delete
End If
Else
Dim dr4 As DataRow = DataTables("出入库").AddNew()
dr4("出入库单号") = ckdh
dr4("出入库日期") = e.DataRow("送货日期")
dr4("出入原因") = "出库-客户出货"
dr4("部供客简称") = "施耐德广州"
dr4("物料编号") = e.DataRow("产品型号")
dr4("出库数量") = (-1) * e.newvalue - e.oldvalue
dr4("单价") = dr22("单价")
dr4("录入员核对") = True
End If
End If
上面代码是放在“组装送货单”这个数据表之“Datacolchanged”里面的,但是红色的那些代码起不了作用,尤其是“录入员核对”这两句更是奇怪, dr3("录入员核对") = True 这句起作用,而 dr4("录入员核对") = True 则不起作用。不知道是什么原因?