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));
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 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));
 }