Exemplo n.º 1
0
        public ActionResult UpdateJumbotronContent(UpdateStartPageContentViewModel model)
        {
            var titleKey     = Controller.Content.ContentTypeKey.StartPageTitle;
            var subtitleKey  = Controller.Content.ContentTypeKey.StartPageSubtitle;
            var paragraphKey = Controller.Content.ContentTypeKey.StartPageParagraph;
            var buttonKey    = Controller.Content.ContentTypeKey.StartPageButton;

            string encodedTitle     = HttpUtility.HtmlEncode(model.Title);
            string encodedSubtitle  = HttpUtility.HtmlEncode(model.Subtitle);
            string encodedParagraph = HttpUtility.HtmlEncode(model.Paragraph);
            string encodedButton    = HttpUtility.HtmlEncode(model.Button);

            if (controller.Update(titleKey, encodedTitle) &&
                controller.Update(subtitleKey, encodedSubtitle) &&
                controller.Update(paragraphKey, encodedParagraph) &&
                controller.Update(buttonKey, encodedButton) &&
                controller.ResultManager.IsCorrect)
            {
                NotifyUser(messageOk: "Contenido texto de jumbotron editado correctamente");
                return(RedirectToAction("Index"));
            }

            NotifyUser(resultManager: controller.ResultManager);
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult ContactPageUpdate(UpdateHtmlContentViewModel model)
        {
            var jumbotronTextKey = Controller.Content.ContentTypeKey.ContactPageContent;

            string encodedContent = HttpUtility.HtmlEncode(model.Content);

            if (controller.Update(jumbotronTextKey, encodedContent) || controller.ResultManager.IsCorrect)
            {
                NotifyUser(messageOk: "Contenido texto para pagina de contacto editado correctamente");
                return(RedirectToAction("Index"));
            }

            NotifyUser(resultManager: controller.ResultManager);
            return(View(model));
        }