Ejemplo n.º 1
0
        /// <summary>
        /// 获取限购配置
        /// </summary>
        /// <param name="activityId"></param>
        /// <returns></returns>
        public BankMRActivityLimitConfig FetchBankMRActivityLimitConfig(Guid activityId)
        {
            BankMRActivityLimitConfig result = null;

            try
            {
                TuhuGrouponDbScopeManagerReadOnly.Execute(conn => result = BankMRActivityDal.FetchBankMRActivityLimitConfig(conn, activityId));
                var roundConfig = GetBankMRActivityRoundConfigsByActivityId(activityId);
                if (roundConfig != null)
                {
                    if (result == null)
                    {
                        result = new BankMRActivityLimitConfig();
                    }
                    result.RoundLimit = roundConfig.FirstOrDefault()?.LimitCount ?? 0;
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
            };

            return(result);
        }