Ejemplo n.º 1
0
        public ActionResult AddPageContent(PageContentViewModel model)
        {
            if (GetCommand<SaveContentCommand>().ExecuteCommand(model))
            {
                return Json(new WireJson { Success = true });
            }

            return Json(new WireJson { Success = false });
        }
Ejemplo n.º 2
0
        public ActionResult AddPageContent(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);
        }
Ejemplo n.º 3
0
        public ActionResult SavePageHtmlContent(PageContentViewModel model)
        {
            try
            {
                var result = GetCommand<SavePageHtmlContentCommand>().ExecuteCommand(model);

                if (result != null)
                {
                    return
                        Json(
                            new WireJson
                                {
                                    Success = true,
                                    Data =
                                        new
                                            {
                                                PageContentId = result.PageContentId,
                                                ContentId = result.ContentId,
                                                RegionId = result.RegionId,
                                                PageId = result.PageId,
                                                DesirableStatus = model.DesirableStatus
                                            }
                                });
                }

                return Json(new WireJson { Success = false });
            }
            catch (ConfirmationRequestException exc)
            {
                return Json(new WireJson { Success = false, Data = new { ConfirmationMessage = exc.Resource() } });
            }
        }
Ejemplo n.º 4
0
        public ActionResult SavePageHtmlContent(PageContentViewModel model)
        {
            var result = GetCommand<SavePageHtmlContentCommand>().ExecuteCommand(model);

            if (result != null)
            {
                return Json(
                    new WireJson
                        {
                            Success = true,
                            Data = new
                                       {
                                           PageContentId = result.PageContentId,
                                           ContentId = result.ContentId,
                                           RegionId = result.RegionId,
                                           PageId = result.PageId,
                                           DesirableStatus = model.DesirableStatus
                                       }
                        });
            }

            return Json(new WireJson { Success = false });
        }