public ActionResult DeleteConfirmed(int id) { PestLocation pestLocation = db.PestLocation.Find(id); db.PestLocation.Remove(pestLocation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "column_0,Scientific_Name,Vernacular_name,Event_Date__parsed,Latitude,Longitude")] PestLocation pestLocation) { if (ModelState.IsValid) { db.Entry(pestLocation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pestLocation)); }
// GET: PestLocations/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PestLocation pestLocation = db.PestLocation.Find(id); if (pestLocation == null) { return(HttpNotFound()); } return(View(pestLocation)); }