public ActionResult DeleteMap(int id) { var mapsCtrl = new MapsController(); BaseResponse response = mapsCtrl.DeleteMap(id); ListResponse<Map> maps = mapsCtrl.GetMaps(); return response.Status == RespsonseStatus.Error ? (ActionResult) RedirectToAction("Error") : View("_Maps", maps); }
public ActionResult Index(string partialViewName, object viewModel) { if (string.IsNullOrWhiteSpace(partialViewName)) { ViewBag.PartialViewName = "_Maps"; var mapsCtrl = new MapsController(); viewModel = mapsCtrl.GetMaps(); } else ViewBag.PartialViewName = partialViewName; return View("Index", viewModel); }
public ActionResult GetMaps() { var mapsCtrl = new MapsController(); ListResponse<Map> maps = mapsCtrl.GetMaps(); return PartialView("_Maps", maps); }