Beispiel #1
0
 private void SetupFbMeta(ArticleModel model)
 {
     ViewBag.FbOgTitle = model.ArticleTitle;
     ViewBag.FbOgImage = WebUtility.GetFullUrl(model.TeaserImageUrl);
     ViewBag.FbOgDescription = model.ArticleTeaser;
     ViewBag.FbOgUrl = WebUtility.GetFullUrl(model.ArticleUrl);
 }
 public ActionResult Edit(int articleId)
 {
     var articleItemDto = _adminArticleService.GetArticleItem(CurrentProfile.ClientId, articleId);
     var model = new ArticleModel().InjectFrom(articleItemDto) as ArticleModel;
     SetEditViewBag();
     return View(model);
 }
 public ActionResult Edit(ArticleModel articleModel)
 {
     var dto = new ArticleItemDto();
     dto.InjectFrom(articleModel);
     var result = _adminArticleService.SaveArticleItem(CurrentProfile.ClientId, dto);
     if (result.IsValid)
     {
         return RedirectToAction("Index");
     }
     ModelState.AddModelError(string.Empty, result.ValidationSummaryToString());
     SetEditViewBag();
     return View(articleModel);
 }