Пример #1
0
 public ActionResult Edit(int dailyBreadId)
 {
     var dailyBreadItemDto = _adminDailyBreadService.GetDailyBreadItem(CurrentProfile.ClientId, dailyBreadId);
     var model = new DailyBreadModel().InjectFrom(dailyBreadItemDto) as DailyBreadModel;
     SetEditViewBag();
     return View(model);
 }
Пример #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);
 }
Пример #3
0
 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);
 }