Exemple #1
0
 public override void ChangeStatus(WfStatusType newstatus)
 {
     IWfStateEventAudit audit = new WfStateEventAudit(this, this.proinst.Status, newstatus);
     this.requester.ReceiveEvent(audit);
     if (((base.WfState == WfStateType.Open) && (base.WhileOpen == WhileOpenType.NotRunning)) && (newstatus == WfStatusType.WF_RUNNING))
     {
         if (LoggingService.IsInfoEnabled)
         {
             LoggingService.Info("Started process:" + this.proinst.Id);
         }
         this.proinst.StartDate = new DateTime?(DateTimeHelper.GetNow());
     }
     base.ChangeStatus(newstatus);
 }
 public virtual void ChangeStatus(WfStatusType newstatus)
 {
     WfStatusType status = this.wfInstance.Status;
     this.wfInstance.Status = newstatus;
     if (this.WfState == WfStateType.Closed)
     {
         this.wfInstance.EndDate = new DateTime?(DateTimeHelper.GetNow());
         if (status == WfStatusType.WF_NOT_STARTED)
         {
             this.wfInstance.CostTime = 0.0;
         }
         else
         {
             if (LoggingService.IsDebugEnabled)
             {
                 LoggingService.DebugFormatted("计算工作流对象远行总用时", new object[0]);
             }
             this.wfInstance.CostTime += DateTimeHelper.GetCostTimeExcludingHoli(this.LastStateTime.Value, this.wfInstance.EndDate.Value);
         }
     }
     else
     {
         if (LoggingService.IsDebugEnabled)
         {
             LoggingService.DebugFormatted("计算预定完成日期", new object[0]);
         }
         if (this.wfInstance.DueTime > 0.0)
         {
             this.wfInstance.DueDate = new DateTime?(DateTimeHelper.GetDateExcludingHoli(DateTimeHelper.GetNow(), this.wfInstance.DueTime - this.wfInstance.CostTime));
         }
         else
         {
             this.wfInstance.DueDate = new DateTime?(DateTimeHelper.GetNow());
         }
     }
     this.wfInstance.LastStateDate = new DateTime?(DateTimeHelper.GetNow());
 }
 public override void ChangeStatus(WfStatusType newstatus)
 {
     IWfStateEventAudit audit = new WfStateEventAudit(this, this.actinst.Status, newstatus);
     base.ChangeStatus(newstatus);
 }