public ActionResult DeleteConfirmed(int id) { PlaceWeather placeWeather = db.PlaceWeathers.Find(id); db.PlaceWeathers.Remove(placeWeather); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DistrictName,IDDistrict,IDLocation")] PlaceWeather placeWeather) { if (ModelState.IsValid) { db.Entry(placeWeather).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(placeWeather)); }
public ActionResult Create([Bind(Include = "DistrictName,IDDistrict,IDLocation")] PlaceWeather placeWeather) { if (ModelState.IsValid) { db.PlaceWeathers.Add(placeWeather); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(placeWeather)); }
// GET: PlaceWeathers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PlaceWeather placeWeather = db.PlaceWeathers.Find(id); if (placeWeather == null) { return(HttpNotFound()); } return(View(placeWeather)); }