以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码合并  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=110464)

--  作者:有点甜
--  发布时间:2017/12/4 0:24:00
--  
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