Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName,FirstName,ConfirmedEmail,LastName,Program,Semester,StudentId,ProfileImage")] AspNetUser aspNetUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetUser));
 }
 public ActionResult Edit([Bind(Include = "Id,BookTitle,BookPath,UserId,AddedOn,UpdatedOn,BookDescription,AuthorName,BookPrice")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", book.UserId);
     return(View(book));
 }
Exemplo n.º 3
0
 public ActionResult Edit(Book book)
 {
     if (ModelState.IsValid)
     {
         book.UpdatedOn       = DateTime.Now;
         book.UserId          = User.Identity.GetUserId();
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", book.UserId);
     return(View(book));
 }