public ActionResult Edit(int dailyBreadId)
 {
     var dailyBreadItemDto = _adminDailyBreadService.GetDailyBreadItem(CurrentProfile.ClientId, dailyBreadId);
     var model = new DailyBreadModel().InjectFrom(dailyBreadItemDto) as DailyBreadModel;
     SetEditViewBag();
     return View(model);
 }
Esempio n. 2
0
 private void SetupFbMeta(DailyBreadModel model)
 {
     ViewBag.FbOgTitle = model.DailyBreadTitle;
     ViewBag.FbOgImage = WebUtility.GetFullUrl(model.TeaserImageUrl);
     ViewBag.FbOgDescription = model.DailyBreadSummary;
     ViewBag.FbOgUrl = WebUtility.GetFullUrl(model.DailyBreadUrl);
 }
 public ActionResult Edit(DailyBreadModel dailyBreadModel)
 {
     var dto = new DailyBreadItemDto();
     dto.InjectFrom(dailyBreadModel);
     var result = _adminDailyBreadService.SaveDailyBreadItem(CurrentProfile.ClientId, dto);
     if (result.IsValid)
     {
         return RedirectToAction("Index");
     }
     ModelState.AddModelError(string.Empty, result.ValidationSummaryToString());
     SetEditViewBag();
     return View(dailyBreadModel);
 }