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)); }
public ActionResult UpdateJumbotronContent() { var titleKey = Controller.Content.ContentTypeKey.StartPageTitle; ContentData titleToEdit = controller.GetContentDataByKey(titleKey); var subtitleKey = Controller.Content.ContentTypeKey.StartPageSubtitle; ContentData subtitleToEdit = controller.GetContentDataByKey(subtitleKey); var paragraphKey = Controller.Content.ContentTypeKey.StartPageParagraph; ContentData pargraphToEdit = controller.GetContentDataByKey(paragraphKey); var buttonKey = Controller.Content.ContentTypeKey.StartPageButton; ContentData buttonToEdit = controller.GetContentDataByKey(buttonKey); UpdateStartPageContentViewModel model = new UpdateStartPageContentViewModel() { Title = HttpUtility.HtmlDecode(titleToEdit != null ? titleToEdit.Value : "<p><br></p>"), Subtitle = HttpUtility.HtmlDecode(subtitleToEdit != null ? subtitleToEdit.Value : "<p><br></p>"), Paragraph = HttpUtility.HtmlDecode(pargraphToEdit != null ? pargraphToEdit.Value : "<p><br></p>"), Button = HttpUtility.HtmlDecode(buttonToEdit != null ? buttonToEdit.Value : "<p><br></p>") }; return(View(model)); }