Ejemplo n.º 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);
 }
Ejemplo 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);
 }
Ejemplo n.º 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);
 }