Exemple #1
0
        /// <summary>
        /// 自由工作流审核通过
        /// </summary>
        /// <param name="result"></param>
        /// <param name="workFlowAuditInfo"></param>
        /// <returns></returns>
        public int FreeAuditPass(BaseUserInfo userInfo, BaseWorkFlowAuditInfo workFlowAuditInfo)
        {
            int result = 0;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, (dbHelper) =>
            {
                var workFlowCurrentManager       = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                IWorkFlowManager workFlowManager = workFlowCurrentManager.GetWorkFlowManager(workFlowAuditInfo.Id);
                result = workFlowCurrentManager.FreeAuditPass(workFlowManager, workFlowAuditInfo);
            });
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 自由工作流审核通过
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="flowId">工作流主键</param>
        /// <param name="workFlowCategory">类型</param>
        /// <param name="toId">发送给主键</param>
        /// <param name="toFullName">发送给名称</param>
        /// <param name="auditIdea">意见</param>
        /// <returns></returns>
        public int FreeAuditPass(BaseUserInfo userInfo, string flowId, string workFlowCategory, string toId, string toFullName, string auditIdea)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType))
            {
                try
                {
                    dbHelper.Open(WorkFlowDbConnection);
                    IWorkFlowManager           userReportManager      = new UserReportManager(userInfo);
                    BaseWorkFlowCurrentManager workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                    dbHelper.BeginTransaction();
                    returnValue = workFlowCurrentManager.FreeAuditPass(userReportManager, flowId, workFlowCategory, toId, toFullName, auditIdea);
                    dbHelper.CommitTransaction();
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    dbHelper.RollbackTransaction();
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return(returnValue);
        }