Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PlaceOfLiving placeOfLiving = db.PlaceOfLiving.Find(id);

            db.PlaceOfLiving.Remove(placeOfLiving);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ID,Name")] PlaceOfLiving placeOfLiving)
 {
     if (ModelState.IsValid)
     {
         db.Entry(placeOfLiving).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(placeOfLiving));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "ID,Name")] PlaceOfLiving placeOfLiving)
        {
            if (ModelState.IsValid)
            {
                db.PlaceOfLiving.Add(placeOfLiving);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(placeOfLiving));
        }
Exemple #4
0
        // GET: PlaceOfLivings/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PlaceOfLiving placeOfLiving = db.PlaceOfLiving.Find(id);

            if (placeOfLiving == null)
            {
                return(HttpNotFound());
            }
            return(View(placeOfLiving));
        }