Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "CustomerID,FirstName,LastName,Phone")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Ejemplo n.º 2
0
 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.º 3
0
 public ActionResult Edit([Bind(Include = "RentalID,CustomerID,MovieID,RentalDate")] 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));
 }