예제 #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            RequiredLand requiredLand = db.RequiredLands.Find(id);

            db.RequiredLands.Remove(requiredLand);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }
예제 #4
0
        // 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));
        }
예제 #5
0
        // 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));
        }