public ActionResult DeleteConfirmed(Guid id) { GovernedLand governedLand = db.GovernedLands.Find(id); db.GovernedLands.Remove(governedLand); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "landId,isNationalPark,isStatePark,isNationalForest,landName")] GovernedLand governedLand) { if (ModelState.IsValid) { db.Entry(governedLand).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(governedLand)); }
public ActionResult Create([Bind(Include = "landId,isNationalPark,isStatePark,isNationalForest,landName")] GovernedLand governedLand) { if (ModelState.IsValid) { governedLand.landId = Guid.NewGuid(); db.GovernedLands.Add(governedLand); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(governedLand)); }
// GET: GovernedLands/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GovernedLand governedLand = db.GovernedLands.Find(id); if (governedLand == null) { return(HttpNotFound()); } return(View(governedLand)); }