예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,FlightNumber")] Transport transport)
 {
     if (ModelState.IsValid)
     {
         db.Entry(transport).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(transport));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,DepartureStation,ArribalStation,DepartureDate,Price,Currency,IdTransport")] Flight flight)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flight).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdTransport = new SelectList(db.Transport, "Id", "FlightNumber", flight.IdTransport);
     return(View(flight));
 }