Пример #1
0
        public ActionResult AddPageHtmlContent(string pageIdentifier, string regionIdentifier, string parentPageContentIdentifier)
        {
            var addRequest = new InsertHtmlContentRequest
            {
                PageId              = pageIdentifier,
                RegionId            = regionIdentifier,
                ParentPageContentId = parentPageContentIdentifier
            };
            var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(addRequest);

            if (model != null)
            {
                var request = new GetWidgetCategoryRequest();
                model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;
            }

            var view = RenderView("AddPageHtmlContent", model ?? new PageContentViewModel());

            var result = ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
// TODO: very large JSON ~2.1MB on test environment!!!
//            var scriptSerializer = new JavaScriptSerializer();
//            if (result.MaxJsonLength.HasValue)
//            {
//                scriptSerializer.MaxJsonLength = result.MaxJsonLength.Value;
//            }
//            var jsonString = scriptSerializer.Serialize(result.Data);

            return(result);
        }
Пример #2
0
        public ActionResult AddPageHtmlContent(string pageIdentifier, string regionIdentifier, string parentPageContentIdentifier)
        {
            var addRequest = new InsertHtmlContentRequest
            {
                PageId              = pageIdentifier,
                RegionId            = regionIdentifier,
                ParentPageContentId = parentPageContentIdentifier
            };
            var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(addRequest);

            if (model != null)
            {
                var request = new GetWidgetCategoryRequest();
                model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories;
            }

            var view = RenderView("AddPageHtmlContent", model ?? new PageContentViewModel());

            return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet));
        }