Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "IdBook,IdRoom,Description,DateStart,DateEnd,Status")] Book book)
        {
            if (ModelState.IsValid)
            {
                db.Books.Add(book);
                db.SaveChanges();
                AlertManager.CreateAlertAfterCreateBook(book, User.Identity.Name);
                return(RedirectToAction("Details", "Room", new { id = book.IdRoom }));
            }

            return(View(book));
        }