Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "UserId,Name,Address,Contact")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "BookId,Title,SerialNumber,Author,Publisher,qty,IsAvailable")] Books books)
 {
     if (ModelState.IsValid)
     {
         db.Entry(books).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index2"));
     }
     return(View(books));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "BorrowHistoryId,BookId,UserId,BorrowDate,ReturnDate")] BorrowHistory borrowHistory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(borrowHistory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookId = new SelectList(db.Mybooks, "BookId", "Title", borrowHistory.BookId);
     ViewBag.UserId = new SelectList(db.Users, "UserId", "Name", borrowHistory.UserId);
     return(View(borrowHistory));
 }