public ActionResult EditLocation(int id) { ILocationRepo locorepo = LocationRepoFactory.Create(); var location = locorepo.GetLocationById(id); var model = new LocationVM { LocationID = location.LocationID, LocationName = location.LocationName, LocationAddress = location.LocationAddress, LocationDescription = location.LocationDescription, LatitudeCoordinate = location.LatitudeCoordinate, LongitudeCoordinate = location.LongitudeCoordinate, }; locorepo.EditLocation(location); return(View(model)); }
public ActionResult EditLocation(LocationVM l) { ILocationRepo locorepo = LocationRepoFactory.Create(); if (ModelState.IsValid) { var location = new Location { LocationID = l.LocationID, LocationName = l.LocationName, LocationAddress = l.LocationAddress, LocationDescription = l.LocationDescription, LatitudeCoordinate = l.LatitudeCoordinate, LongitudeCoordinate = l.LongitudeCoordinate, }; locorepo.EditLocation(location); } return(RedirectToAction("LocationList")); }