public void DeleteCity(DeleteCityRequest request) { if (request != null) { var dataAccess = new CityDataAccess(request.Context); var city = dataAccess.GetById(request.IdCity); dataAccess.Delete(city.FirstOrDefault()); } }
public ActionResult DeleteConfirm(int id) { if (CityDataAccess.Delete(id)) { return(Json(new { success = true, message = "Success" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = CityDataAccess.Message }, JsonRequestBehavior.AllowGet)); } }