/// <summary>
        /// 删除一个流程模板
        /// </summary>
        /// <param name="workflowId">流程模板Id</param>
        /// <returns></returns>
        public int DeleteWorkFlow(string workflowId)
        {
            int returnInt = -1;

            if (workflowId.Trim().Length == 0 || workflowId == null)
            {
                throw new Exception("DeleteWorkFlow方法错误,workflowId 不能为空!");
            }

            try
            {
                //1、存储过程方式删除流程模板
                //returnInt = this.DBProvider.ExecuteProcedure("DeleteWorkFlow", new IDbDataParameter[] { DBProvider.MakeParameter(WorkFlowTemplateTable.FieldWorkFlowId, workflowId) });

                /*
                 *  删除的各语句
                 *  DELETE  WORKFLOW  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKTASK  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKLINK  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  TASKVAR   WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  OPERATOR  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKTASKCOMMANDS  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  SUBWORKFLOW  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKTASKCONTROLS WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKFLOWEVENT  WHERE   WORKFLOWID = @WORKFLOWID
                 *  DELETE  WORKOUTTIME  WHERE   WORKFLOWID = @WORKFLOWID
                 */
                //2、直接语句方式删除流程模板
                //2.1、删除流程模板
                returnInt += new WorkFlowTemplateManager(DBProvider, this.UserInfo, WorkFlowTemplateTable.TableName).Delete(WorkFlowTemplateTable.FieldWorkFlowId, workflowId);
                //2.2、删除任务节点
                returnInt += new WorkTaskManager(DBProvider, this.UserInfo, WorkFlowTemplateTable.TableName).Delete(WorkTaskTable.FieldWorkFlowId, workflowId);
                //2.3、删除连线
                returnInt += new WorkLinkManager(DBProvider, this.UserInfo, WorkLinkTable.TableName).Delete(WorkLinkTable.FieldWorkFlowId, workflowId);
                //2.4、删除任务节点变量
                returnInt += new TaskVarManager(DBProvider, this.UserInfo, TaskVarTable.TableName).Delete(TaskVarTable.FieldWorkFlowId, workflowId);
                //2.5、删除操作者
                returnInt += new OperatorManager(DBProvider, this.UserInfo, OperatorTable.TableName).Delete(OperatorTable.FieldWorkFlowId, workflowId);
                //2.5、删除任务节点命令
                returnInt += new WorkTaskCommandsManager(DBProvider, this.UserInfo, WorkTaskCommandsTable.TableName).Delete(WorkTaskCommandsTable.FieldWorkFlowId, workflowId);
                //2.6、删除子流程
                returnInt += new SubWorkFlowManager(DBProvider, this.UserInfo, SubWorkFlowTable.TableName).Delete(SubWorkFlowTable.FieldWorkFlowId, workflowId);
                //2.7、删除任务节点表单
                returnInt += new WorkTaskControlsManager(DBProvider, this.UserInfo, WorkTaskControlsTable.TableName).Delete(WorkTaskControlsTable.FieldWorkflowId, workflowId);
                //2.8、删除任务节点事件通知
                returnInt += new WorkFlowEventManager(DBProvider, this.UserInfo, WorkFlowEventTable.TableName).Delete(WorkFlowEventTable.FieldWorkFlowId, workflowId);
                //2.9、删除任务节点工作任务超时设置
                returnInt += new WorkOutTimeManager(DBProvider, this.UserInfo, WorkOutTimeTable.TableName).Delete(WorkOutTimeTable.FieldWorkFlowId, workflowId);
            }
            catch (Exception ex)
            {
                throw new Exception("BizLogicError:删除流程失败,请与管理员联系!Error:" + ex.Message);
            }
            return(returnInt);
        }
        /// <summary>
        /// 得到指定流程模版所有的超时设置列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workFlowId">流程模版Id</param>
        /// <returns>超时设置列表</returns>
        public DataTable GetWorkFlowAllOutTimeTable(UserInfo userInfo, string workFlowId)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkFlowAllOutTimeTable);
            var dataTable = new DataTable(WorkOutTimeTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkFlowAllOutTimeTable(workFlowId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 增加工作任务超时设置
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">工作任务超时实体</param>
        /// <returns>增加成功返回实体主键</returns>
        public string InsertWorkOutTime(UserInfo userInfo, WorkOutTimeEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_InsertWorkOutTime);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.InsertWorkOutTime(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 根据工作任务模版主键删除超时设置记录
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workTaskId">工作任务Id</param>
        /// <returns>大于0成功</returns>
        public int DeleteWorkOutTime(UserInfo userInfo, string workTaskId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_DeleteWorkOutTime);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.DeleteWorkOutTime(workTaskId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 依据工作任务主键得到超时设置实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskid">工作任务Id</param>
        /// <returns>超时设置实体</returns>
        public WorkOutTimeEntity GetWorkOutTimeInfo(UserInfo userInfo, string worktaskid)
        {
            WorkOutTimeEntity returnValue = null;
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkOutTimeInfo);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.GetWorkOutTimeInfo(worktaskid);
            });
            return(returnValue);
        }