public JsonResult Update(int locID, string newName, string newAdress, string newHours, string newDescription) { HandleLocationViewModel model = new HandleLocationViewModel() { ID = locID, Name = newName, Adress = newAdress, Hours = newHours, Description = newDescription }; bool locationUpdated = HandleLocationViewModel.UpdateMarker(contextNH, model); return(new JsonResult(locationUpdated)); }
public IActionResult HandleLocation(AdminIndexViewModel model) { if (model != null) { List <HandleLocationViewModel> locationList = HandleLocationViewModel.GetLocations(contextNH, context, model); if (locationList != null) { return(View(locationList)); } else { ViewData["Message"] = "Kunde inte hitta några skötbord som matchar din sökning"; return(View("AdminIndex")); } } else { ViewData["Message"] = "Något gick fel försök igen"; return(View("AdminIndex")); } }
public JsonResult Delete(int id) { bool locationDeleted = HandleLocationViewModel.DeleteMarker(contextNH, id); return(new JsonResult(locationDeleted)); }