예제 #1
0
 /// <summary>
 /// 更新任务完成状态
 /// </summary>
 /// <param name="processId">流程实例主键</param>
 /// <param name="nodeId">节点主键</param>
 /// <param name="taskId">任务节点Id</param>
 /// <param name="userId">用户主键</param>
 /// <param name="userName">用户名称</param>
 public void UpdateStateByNodeId(string processId, string nodeId, string taskId, string userId, string userName)
 {
     try
     {
         var list = this.BaseRepository().FindList <WfTaskEntity>(t => t.F_ProcessId == processId && t.F_IsFinished == 0 && t.F_NodeId == nodeId);
         foreach (var item in list)
         {
             WfTaskEntity wfTaskEntity = new WfTaskEntity();
             wfTaskEntity.Modify(item.F_Id);
             wfTaskEntity.F_IsFinished = 1;
             if (taskId == item.F_Id)
             {
                 wfTaskEntity.F_ModifyUserId = userId;
             }
             wfTaskEntity.F_ModifyUserName = userName;
             this.BaseRepository().Update(wfTaskEntity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// 更新任务状态
 /// </summary>
 /// <param name="keyValue">主键</param>
 /// <param name="state">状态 1 完成 2 关闭(会签 </param>
 public void UpdateState(string keyValue, int state)
 {
     try
     {
         WfTaskEntity wfTaskEntity = new WfTaskEntity();
         wfTaskEntity.Modify(keyValue);
         wfTaskEntity.F_IsFinished = state;
         this.BaseRepository().Update(wfTaskEntity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }