Beispiel #1
0
        /// <summary>
        /// Gets widget zones where this widget should be rendered
        /// </summary>
        /// <returns>Widget zones</returns>
        public IList <string> GetWidgetZones()
        {
            var bannerPlacements = _bannerService.GetAllBannerWidgetzones();
            var returnStr        = new List <string>();

            foreach (var bp in bannerPlacements)
            {
                returnStr.Add(bp.WidgetZone);
            }
            return(returnStr);
            //return new List<string>() { "home_page_top" };
        }
        public ActionResult BannerWidgetzoneList(DataSourceRequest command)
        {
            var records  = _bannerService.GetAllBannerWidgetzones(command.Page - 1, command.PageSize);
            var sbwModel = records.Select(x =>
            {
                var m = new BannerWidgetzoneModel()
                {
                    Id         = x.Id,
                    Widgetzone = x.WidgetZone,
                    IsStatic   = x.IsStatic,
                };
                return(m);
            })
                           .ToList();
            var gridModel = new DataSourceResult
            {
                Data  = sbwModel,
                Total = records.Count
            };

            return(Json(gridModel));
        }