public ActionResult Edit([Bind(Include = "CustomerID,CustomerName,CustomerPhone")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "GenreID,GenreName")] Genre genre) { if (ModelState.IsValid) { db.Entry(genre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(genre)); }
public ActionResult Edit([Bind(Include = "MovieID,MovieName,MovieDescription,MovieGenre")] Movie movie) { if (ModelState.IsValid) { db.Entry(movie).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MovieGenre = new SelectList(db.Genres, "GenreID", "GenreName", movie.MovieGenre); return(View(movie)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] Movy movy) { if (ModelState.IsValid) { db.Entry(movy).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(movy)); }
public ActionResult Edit([Bind(Include = "RentalID,MovieID,CustomerID,RentalDate,DueDate,ReturnDate")] RentalRecord rentalRecord) { if (ModelState.IsValid) { db.Entry(rentalRecord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MovieID = new SelectList(db.Movies, "MovieID", "MovieName", rentalRecord.MovieID); return(View(rentalRecord)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,AspNetUserID,FirstName,LastName,DateOfBirth")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.AspNetUserID = new SelectList(db.AspNetUsers, "Id", "Email", customer.AspNetUserID); return(View(customer)); }