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 }); }
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 }); }
public ActionResult UpdateHighlight(HighlightViewModel viewModel) { var req = viewModel.MapTo<SaveHighlightRequest>(); var resp = _highlightService.SaveHighlight(req); return Json(resp); }