Beispiel #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email,Content")] Guestbook guestbook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(guestbook).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(guestbook));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ID,Name")] Face face)
 {
     if (ModelState.IsValid)
     {
         db.Entry(face).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(face));
 }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "ID,Name,Description,Owner")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(book));
 }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "ID,Name,Comment,FaceID,BookID")] Guest guest)
 {
     if (ModelState.IsValid)
     {
         db.Entry(guest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookID = new SelectList(db.Books, "ID", "Name", guest.BookID);
     ViewBag.FaceID = new SelectList(db.Faces, "ID", "Name", guest.FaceID);
     return(View(guest));
 }