Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ResourseLocation resourseLocation = db.ResourseLocation.Find(id);

            db.ResourseLocation.Remove(resourseLocation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        // 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));
        }
Example #4
0
        // 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));
        }