public ActionResult DeleteConfirmed(Guid id) { RequiredLand requiredLand = db.RequiredLands.Find(id); db.RequiredLands.Remove(requiredLand); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Address,Reason,PotentialCost,AreaRequired,FireStationId")] RequiredLand requiredLand) { if (ModelState.IsValid) { db.Entry(requiredLand).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FireStationId = new SelectList(DataFilter.GetFireStations(TempData.Peek("Id") + ""), "Id", "Name", requiredLand.FireStationId); return(View(requiredLand)); }
public ActionResult Create([Bind(Include = "Id,Address,Reason,PotentialCost,AreaRequired,FireStationId")] RequiredLand requiredLand) { if (ModelState.IsValid) { requiredLand.Id = Guid.NewGuid(); db.RequiredLands.Add(requiredLand); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FireStationId = new SelectList(DataFilter.GetFireStations(TempData.Peek("Id") + ""), "Id", "Name", requiredLand.FireStationId); return(View(requiredLand)); }
// GET: RequiredLands/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RequiredLand requiredLand = db.RequiredLands.Find(id); if (requiredLand == null) { return(HttpNotFound()); } return(View(requiredLand)); }
// GET: RequiredLands/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RequiredLand requiredLand = db.RequiredLands.Find(id); if (requiredLand == null) { return(HttpNotFound()); } ViewBag.FireStationId = new SelectList(DataFilter.GetFireStations(TempData.Peek("Id") + ""), "Id", "Name", requiredLand.FireStationId); return(View(requiredLand)); }