|
楼主 |
发表于 2007-7-27 16:36:14
|
显示全部楼层
procedure TZLNLPG.ProcAfterFlowFinish(Sender: TObject; Command: TFlowFinishCommand);
var
query1:Tquery;
begin
query1:=Tquery.Create(nil);
try
query1.ConnectionString:='DATABASEURL=Biz:\GYSGL\SMIS_DATABASE.Database';
query1.CommandText:='SELECT COUNT(PGDH) COUNT FROM SCNLPGZB WHERE PGDH='''+Command.FlowControl.Flow.ID+'''';
query1.Execute;
if query1.FieldByName('COUNT').AsInteger =0 then
begin
query1.CommandText:='INSERT INTO SCNLPGZB (PGDH,GYSBH,GYSMC,GYSSZD,LJBH,LJMC,LJGG,PGZT) SELECT PGDH,GYSBH,GYSMC,GYSSZD,LJBH,LJMC,LJGG,0 FROM ZLNLPGZB WHERE ZLNLPGZB.PGDH ='''+Command.FlowControl.Flow.ID+'''';
query1.Execute;
end;
finally
query1.Free;
end;
end; |
|