コード例 #1
0
        public JsonResult GetPopUpWindowsConfigById()
        {
            var model = BeautyHomePageConfigManager.GetBeautyPopUpWindowsConfigById(PKID) ?? new BeautyPopUpWindowsConfig()
            {
                Channel = "ios"
            };
            var categorys = BeautyHomePageConfigManager.GetBeautyCategoryByChannel(model.Channel);
            List <PromotionInfoModel> promotions = new List <PromotionInfoModel>();

            if (!string.IsNullOrEmpty(model.PromotionInfo))
            {
                promotions = JsonConvert.DeserializeObject <List <PromotionInfoModel> >(model.PromotionInfo);
            }
            List <BeautyPopUpWindowsRegionModel> regions = new List <BeautyPopUpWindowsRegionModel>();

            if (model.IsRegion && model.PKID > 0)
            {
                regions = BeautyHomePageConfigManager.GetBeautyPopUpWindowsRegionConfigs(model.PKID)?.ToList();
            }


            return(Json(new
            {
                result = model,
                CategoryList = categorys,
                PromotionList = promotions,
                RegionList = regions
            }));
        }