JackQu的程序员博客

欢迎来的我Blog.这里记录工作学习的点滴,愿与大家分享。欢迎大家共同交流 。

导航

创建新业务单据,并关闭旧单据

  procedure OpenCRKbills(aActID,aEntityID : Integer);
    var wfPkg_Bill: TWorkflowPackage;
  begin
    wfPkg_Bill.AppHandle:=Application.Handle;
    wfPkg_Bill.FormHandle:=0;
    wfPkg_Bill.ParentWindow:=0;
    wfPkg_Bill.PreSender:=0;
    wfPkg_Bill.PreSenderID:=0;
    wfPkg_Bill.Sender:=0;
    wfPkg_Bill.ProcID:=0;
    wfPkg_Bill.ActivityID:=aActID;
    wfPkg_Bill.TaskID:=0;
    wfPkg_Bill.TaskStatus:=wftsFinished;
    wfPkg_Bill.EntityID:=aEntityID;
    wfPkg_Bill.SQLCmdName:='';
    wfPkg_Bill.ReportIdent:='';
    ExecWorkflowPackage(wfPkg_Bill, Proc_ProcessTask);
  end;


 procedure  BitBtnNewBillClick(Sender:Tobject);
  var AEntityID,ABillDeptID,i:Integer;
      Abn: TBillNo;
      Awfp:TWorkflowPackage;
 begin
   Awfp:=GetCurrentWorkflowPackage;
   ActivityCreateTasks(Awfp.Activityid,AEntityID);
   if AEntityid>0 then begin
     HostForm.Close;
     OpenCRKbills(Awfp.Activityid,AEntityID);
   end;
 end;

 

posted on 2013-11-23 15:01  Qcj  阅读(314)  评论(0编辑  收藏  举报