学会调试
If e.GetValues.ContainsKey("type") Then
msgbox(e.GetValues("type"))
Select Case CInt(e.GetValues("type"))
Case 1
Dim barcode As String = e.GetValues("code")
Dim smlx As String = e.GetValues("smlx")
Dim jggx As String = e.GetValues("jggx")
msgbox(barcode )
cmd1.CommandText = "Select sum(待转数量) From 过程异常明细 Where 毛坯编码 = '" & barcode & "'"
dim k as integer = cmd1.ExecuteScalar
msgbox("第一次=" & k)
If k > 0 Then
code = 1
msg = "请解封不良记录"
cmd1.CommandText = "Select Count(*) From 工序跟踪表 Where 毛坯编码 = '" & barcode & "' And 加工工序 = '" & jggx & "' And 扫码类型 = '" & smlx & "'"
k = cmd1.ExecuteScalar
msgbox("第2次=" & k)
If k > 0 Then
code = 1
msg = "请勿重复扫码"
……