public ActionResult Edit([Bind(Include = "MovieID,Title,Director,Genre")] Movy movy) { if (ModelState.IsValid) { db.Entry(movy).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movy)); }
public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Phone")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "RentalID,CustomerID,MovieID,DateRented")] Rental rental) { if (ModelState.IsValid) { db.Entry(rental).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "FirstName", rental.CustomerID); ViewBag.MovieID = new SelectList(db.Movies, "MovieID", "Title", rental.MovieID); return(View(rental)); }