好像不行 这个窗口会被反复打开
If e.NewValue IsNot Nothing Then
Do Until forms("预检单").opened=false then
If Functions.Execute("预检",e.DataCol.name.Replace("人",""),e.DataRow("_identify"),e.DataTable.name)=False Then
e.Cancel=True
MessageBox.show("制程预检未确认,当前操作撤销!","提示")
End If
loop
End If
预检函数
Dim lc As String=args(0)
Dim id As Integer=args(1)
Dim dn As String=args(2)
Dim lt As List(of DataRow)=DataTables("预检项目").SQLSel ect("单据名称='" & dn & "' and 流程名称='" & lc & "'")
Dim lst As List(of DataRow)=DataTables("预检单").SQLSel ect("单据名称='" & dn & "' and 单据ID='" & id & "' and 流程名称='" & lc & "'")
If lt.count=0 Then
Return True
Else
If lst.count=0 Then
For Each dr As DataRow In lt
Dim r As Row=Tables("预检单").addnew
r("预检人")=_username
Dim time As Date=Functions.Execute("服务器时间")
r("预检时间")=time
r("单据名称")=dn
r("流程名称")=lc
r("预检项目")=dr("项目名称")
r("单据id")=id
Next
vars("节点")=lc & "预检"
Forms("预检单").show
If Forms("预检单").Opened=False Then
If vars("预检")=False OrElse DataTables("预检单").sqlSe lect("单据id='" & id & "' and 预检结果_确认=0").count>0 Then
Return False
Else
Return True
End If
End If
Else
DataTables("预检单").LoadFilter="单据名称='" & dn & "' and 单据ID='" & id & "' and 流程名称='" & lc & "'"
DataTables("预检单").Load
vars("节点")= lc & "预检"
Forms("预检单").show
If Forms("预检单").Opened=False Then
If vars("预检")=False OrElse DataTables("预检单").sqlSelect("单据id='" & id & "' and 预检结果_确认=0").count>0 Then
Return False
Else
Return True
End If
End If
End If
End If