예제 #1
0
 public ActionResult Edit(HighlightViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveHighlightRequest>();
     var resp = _highlightService.SaveHighlight(req);
     TempData["IsSuccess"] = resp.IsSuccess;
     TempData["Message"] = resp.Message;
     if (resp.IsSuccess)
     {
         return RedirectToAction("Display");
     }
     return RedirectToAction("Edit", new { id = viewModel.Id });
 }
예제 #2
0
 public ActionResult Manage(HighlightViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveHighlightRequest>();
     if (viewModel.AsNew) {
         req.Id = 0;
     }
     var resp = _highlightService.SaveHighlight(req);
     TempData["IsSuccess"] = resp.IsSuccess;
     TempData["Message"] = resp.Message;
     if (resp.IsSuccess)
     {
         return RedirectToAction("Display");
     }
     return RedirectToAction("Manage", new { HighlightId = viewModel.Id });
 }
예제 #3
0
 public ActionResult UpdateHighlight(HighlightViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveHighlightRequest>();
     var resp = _highlightService.SaveHighlight(req);
     return Json(resp);
 }