我之前代码就是这么写的。用isnull。但发现去执行了蓝色的代码。注:scriptval8后台的值就是NULL
Dim dr5 As DataRow = DataTables("assemblyScriptParamter").SQLFind("workOrderNo = '" & dr3("WorkOrderNo") & "' and lineFlag = '" & dr2("LineFlag") & "'")
If dr5 IsNot Nothing Then
If dr5.IsNull("scriptval8") Then
Dim kwlb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox1")
Dim rklb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox2")
e.DataRow("库位类别") = kwlb.text
e.DataRow("入库类别") = rklb.text
e.DataRow("数量") = 1
e.DataRow("状态") = "生产结束扫描完成"
e.DataRow("入库方式") = "扫描入库"
e.DataRow("生产结束扫描完成时间") = Date.now
e.DataRow.locked = True
e.DataRow.Save
Dim ssdsl As WinForm.Button = Forms("生产入库").Controls("Button3")
Dim sum As Integer = DataTables("扫描配货明细").SQLCompute("Sum(数量)","状态 = '生产结束扫描完成'")
ssdsl.text = "实扫到数量:" & sum
Else
If dr1("status") = "-1" Then
Dim kwlb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox1")
Dim rklb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox2")
e.DataRow("库位类别") = kwlb.text
e.DataRow("入库类别") = rklb.text
e.DataRow("数量") = 1
e.DataRow("状态") = "生产结束扫描完成"
e.DataRow("入库方式") = "扫描入库"
e.DataRow("生产结束扫描完成时间") = Date.now
e.DataRow.locked = True
e.DataRow.Save
Dim ssdsl As WinForm.Button = Forms("生产入库").Controls("Button3")
Dim sum As Integer = DataTables("扫描配货明细").SQLCompute("Sum(数量)","状态 = '生产结束扫描完成'")
ssdsl.text = "实扫到数量:" & sum
Else
e.DataRow("数量") = 0
e.DataRow("状态") = "不符合入库条件"
e.DataRow.locked = True
Dim drr12 As DataRow = DataTables("生产扫描异常").Find("SN = '" & e.DataRow("SN") & "' and 生产订单号码工单行号 = '" & e.DataRow("生产订单号码工单行号") & "'")
If drr12 Is Nothing Then
Dim drrr12 As DataRow = DataTables("生产扫描异常").AddNew
For Each nm As String In nms
drrr12(nm) = e.DataRow(nm)
Next
drrr12("生产订单号码工单行号") = gdhhh.text
drrr12("数量") = 0
drrr12("SN") = e.DataRow("SN")
drrr12.Locked = True
End If
End If
End If