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); }
public ActionResult SelectWidget(GetWidgetCategoryRequest request) { var model = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request); var view = model != null?RenderView("SelectWidget", model.WidgetCategories) : string.Empty; return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet)); }
public ActionResult Widgets(string query) { var request = new GetWidgetCategoryRequest { Filter = query }; var model = GetCommand<GetWidgetCategoryCommand>().ExecuteCommand(request); return PartialView(model.WidgetCategories); }
public ActionResult AddPageHtmlContent(string pageId, string regionId) { var viewModel = new PageContentViewModel { PageId = Guid.Parse(pageId), RegionId = Guid.Parse(regionId), LiveFrom = DateTime.Today }; var request = new GetWidgetCategoryRequest(); viewModel.WidgetCategories = GetCommand<GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories; return View(viewModel); }
public ActionResult AddPageHtmlContent(string pageId, string regionId) { var model = GetCommand <GetInsertHtmlContentCommand>().ExecuteCommand(new InsertHtmlContentRequest() { PageId = pageId, RegionId = regionId }); var request = new GetWidgetCategoryRequest(); model.WidgetCategories = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request).WidgetCategories; var view = RenderView("AddPageHtmlContent", model); return(ComboWireJson(model != null, view, model, JsonRequestBehavior.AllowGet)); }
public ActionResult SelectWidget(GetWidgetCategoryRequest request) { var model = GetCommand <GetWidgetCategoryCommand>().ExecuteCommand(request); var view = model != null?RenderView("SelectWidget", model.WidgetCategories) : string.Empty; 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); }
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)); }