Example #1
0
        /// <summary>
        /// 인자에 해당하는 조건으로 설정된 상세 배너를 1개 반환합니다.
        /// </summary>
        /// <param name="applSystemCD"></param>
        /// <param name="areaCD"></param>
        /// <param name="goodsTypeCD"></param>
        /// <param name="baseGoodsCD"></param>
        /// <param name="goodsCD"></param>
        /// <param name="supplierCD"></param>
        /// <param name="natCD_List"></param>
        /// <param name="cityCD_List"></param>
        /// <param name="startDate"></param>
        /// <param name="ippId"></param>
        /// <param name="currentCateCD"></param>
        /// <returns></returns>
        public ViewModelBannerWithConditions GetSingleGoodsBannerWithConditions(string applSystemCD, string areaCD, string goodsTypeCD, string baseGoodsCD, string goodsCD, string supplierCD, string natCD_List, string cityCD_List, string startDate, string ippId, string exposeType, int currentCateCD)
        {
            var option = new TransactionOptions
            {
                // Isolation Level 에 주의
                IsolationLevel = IsolationLevel.ReadUncommitted,
                Timeout        = TransactionManager.DefaultTimeout
            };

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress, option))
            {
                List <ViewModelBannerWithConditions> tmpList      = _daoGlobal.GetGoodsBannerWithConditions(applSystemCD, areaCD, goodsTypeCD, baseGoodsCD, goodsCD, supplierCD, natCD_List, cityCD_List, startDate, ippId, exposeType, currentCateCD);
                ViewModelBannerWithConditions        returnResult = null;

                if (tmpList != null)
                {
                    Random random = new Random();

                    int randomNum = 0;

                    if (tmpList.Count > 0)
                    {
                        randomNum    = random.Next(0, tmpList.Count - 1);
                        returnResult = tmpList[randomNum];
                    }
                }

                return(returnResult);
            }
        }