Beispiel #1
0
        public ActionResult Create(Room room)
        {
            if (ModelState.IsValid)
            {
                db.Rooms.Add(room);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(room);
        }
Beispiel #2
0
 public ActionResult Edit(Room room)
 {
     if (ModelState.IsValid)
     {
         db.Entry(room).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(room);
 }