public ActionResult EditLocationPlace(int id) { var location = locationPlaceService.GetLocationPlaceById(id); if (location != null) { var editLocation = new LocationPlaceModel(location); return(View(editLocation)); } return(RedirectToAction("Index")); }
public ActionResult SaveLocationPlace(LocationPlaceModel newLocation) { if (ModelState.IsValid) { var saveLocationPlace = new LocationPlace { Id = newLocation.Id, LocationName = newLocation.LocationName }; locationPlaceService.SaveLocationPlace(saveLocationPlace); return(RedirectToAction("Index")); } return(View("EditLocationPlace", newLocation)); }
public ActionResult CreateLocationPlace() { var model = new LocationPlaceModel(); return(View("EditLocationPlace", model)); }