Пример #1
0
        public override void Init(long websiteWidgetId)
        {
            WebSiteWidgetId = websiteWidgetId;
            ViewFileName    = "Widgets/ImageSlider";

            var webSiteWidget = _websiteWidgetService.Get(websiteWidgetId, true);

            if (webSiteWidget != null && !string.IsNullOrEmpty(webSiteWidget.WidgetConfigJson))
            {
                var configJson = webSiteWidget.WidgetConfigJson;
                var config     = JsonConvert.DeserializeObject <dynamic>(configJson);
                Language                = config.language;
                DisplayTitle            = config.title;
                Footer                  = config.footer;
                selectedImageSliderName = config.name;
            }

            ConfigViewFileName = "Widgets/ImageSliderConfig";
            var itemList = _imageSliderService.LoadAll(true).ToList();

            ConfigHtml = _viewRenderService.RenderToStringAsync <ImageSliderWidgetController>(ConfigViewFileName, itemList /*webSiteWidget*/).Result;
        }
        public ActionResult Manage()
        {
            var itemList = _nccImageSliderService.LoadAll().OrderByDescending(x => x.Id).ToList();;

            return(View(itemList));
        }
Пример #3
0
        public ActionResult Index()
        {
            var all = _nccImageSliderService.LoadAll();

            return(View(all));
        }
Пример #4
0
        public override object PrepareConfigModel()
        {
            var model = _imageSliderService.LoadAll(true);

            return(model);
        }