/// <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 GetWorkFlowAllOperator(UserInfo userInfo, string workFlowId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(TaskVarTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkFlowAllOperator(workFlowId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 删除处理者
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="operatorId">处理者主键</param>
        /// <returns>大于0成功</returns>
        public int DeleteOperator(UserInfo userInfo, string operatorId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_DeleteOperator);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.DeleteOperator(operatorId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 增加处理者
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">处理者实体</param>
        /// <returns>增加成功返回实体主键</returns>
        public string InsertOperator(UserInfo userInfo, OperatorEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_InsertOperator);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.InsertOperator(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 是否存在指定处理者
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="operatorId">处理者Id</param>
        /// <returns>true存在</returns>
        public bool ExistsOperator(UserInfo userInfo, string operatorId)
        {
            var returnValue = false;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.Exists(operatorId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 获得指定处理者策略
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="operatorId">处理者Id</param>
        /// <returns>处理者策略</returns>
        public string GetOperRelation(UserInfo userInfo, string operatorId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = string.Empty;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.GetOperRelation(operatorId);
            });
            return(returnValue);
        }