public ActionResult DeleteConfirmed(int id) { ResourseLocation resourseLocation = db.ResourseLocation.Find(id); db.ResourseLocation.Remove(resourseLocation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,locationType,building,floor,name")] ResourseLocation resourseLocation) { if (ModelState.IsValid) { db.Entry(resourseLocation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.building = new SelectList(db.buildings, "ID", "Name", resourseLocation.building); ViewBag.locationType = new SelectList(db.LocType, "id", "type", resourseLocation.locationType); return(View(resourseLocation)); }
// GET: ResourseLocations/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResourseLocation resourseLocation = db.ResourseLocation.Find(id); if (resourseLocation == null) { return(HttpNotFound()); } return(View(resourseLocation)); }
// GET: ResourseLocations/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResourseLocation resourseLocation = db.ResourseLocation.Find(id); if (resourseLocation == null) { return(HttpNotFound()); } ViewBag.building = new SelectList(db.buildings, "ID", "Name", resourseLocation.building); ViewBag.locationType = new SelectList(db.LocType, "id", "type", resourseLocation.locationType); return(View(resourseLocation)); }