Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Location,StartDate,RentalId")] TravelAgency travelAgency)
 {
     if (ModelState.IsValid)
     {
         db.Entry(travelAgency).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RentalId = new SelectList(db.CarRentalCompanies, "Id", "CarType", travelAgency.RentalId);
     return(View(travelAgency));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Description,Latitude,Longitude")] Location location)
 {
     if (ModelState.IsValid)
     {
         db.Entry(location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(location));
 }