Пример #1
0
        /// <summary>
        /// 获取待审批
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="userId">用户主键</param>
        /// <param name="categoryCode">分类代码</param>
        /// <param name="categorybillFullName">单据分类名称</param>
        /// <param name="searchValue">查询字符串</param>
        /// <returns></returns>
        public DataTable GetWaitForAudit(BaseUserInfo userInfo, string userId = null, string categoryCode = null, string categorybillFullName = null, string searchValue = null)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

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

            DataTable dataTable = null;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType))
            {
                try
                {
                    // 这个是获取用户的角色信息
                    dbHelper.Open(UserCenterDbConnection);
                    BaseUserManager userManager = new BaseUserManager(dbHelper);
                    string[]        roleIds     = userManager.GetAllRoleIds(userInfo.Id);
                    dbHelper.Close();
                    // 这里是获取待审核信息
                    dbHelper.Open(WorkFlowDbConnection);
                    BaseWorkFlowCurrentManager workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                    dataTable           = workFlowCurrentManager.GetWaitForAudit(userId, categoryCode, categorybillFullName, searchValue);
                    dataTable.TableName = BaseWorkFlowCurrentEntity.TableName;
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

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

            return(dataTable);
        }
Пример #2
0
        /// <summary>
        /// 获取待审批
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="userId">用户主键</param>
        /// <param name="categoryCode">分类代码</param>
        /// <param name="categorybillFullName">单据分类名称</param>
        /// <param name="searchValue">查询字符串</param>
        /// <returns></returns>
        public DataTable GetWaitForAudit(BaseUserInfo userInfo, string userId = null, string categoryCode = null, string categorybillFullName = null, string searchValue = null)
        {
            DataTable dt = null;

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

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                //BaseUserManager userManager = new BaseUserManager(dbHelper);
                var userManager  = new BaseUserManager(dbHelper, userInfo);
                string[] roleIds = userManager.GetRoleIds(userInfo.Id);
                dbHelper.Close();
                // 这里是获取待审核信息
                dbHelper.Open(WorkFlowDbConnection);
                var workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                dt           = workFlowCurrentManager.GetWaitForAudit(userId, categoryCode, categorybillFullName, searchValue);
                dt.TableName = BaseWorkFlowCurrentEntity.TableName;
            });

            return(dt);
        }