Select Case e.DataCol.name Case "毛坯编码","加工工序" Dim dr As DataRow = e.DataRow If dr.IsNull("毛坯编码") = False AndAlso dr.IsNull("加工工序") = False Then If DataTables("工序记录表_工序跟踪表").Compute("Count([_Identify])","毛坯编码 = '" & dr("毛坯编码") & "' And 加工工序 = '" & dr("加工工序") & "'") > 1 Then MessageBox.Show("工序重号,重新输入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.DataRow(e.DataCol.Name) = e.OldValue '取消输入 ElseIf DataTables("工序跟踪表").Compute("Count([_Identify])","毛坯编码 = '" & dr("毛坯编码") & "' And 加工工序 = '" & dr("加工工序") & "'") > 0 Then MessageBox.Show("工序重号,重新输入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.DataRow(e.DataCol.Name) = e.OldValue '取消输入 End If End If End Select
|