コード例 #1
0
 public ActionResult Edit([Bind(Include = "CityID,Cities")] City city)
 {
     if (ModelState.IsValid)
     {
         db.Entry(city).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(city));
 }
 public ActionResult Edit([Bind(Include = "FlightID,Flight")] Airlines_Arrivals airlines_Arrivals)
 {
     if (ModelState.IsValid)
     {
         db.Entry(airlines_Arrivals).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(airlines_Arrivals));
 }
 public ActionResult Edit([Bind(Include = "Id,FlightNo,FlightID,CityID,Scheduled,StatusID,ArrivalTime,Terminal_ID")] ArrivalsTimeTable arrivalsTimeTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arrivalsTimeTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FlightID    = new SelectList(db.Airlines_Arrivals, "FlightID", "Flight", arrivalsTimeTable.FlightID);
     ViewBag.CityID      = new SelectList(db.Cities, "CityID", "Cities", arrivalsTimeTable.CityID);
     ViewBag.StatusID    = new SelectList(db.StatusReportArrivals, "StatusID", "Status", arrivalsTimeTable.StatusID);
     ViewBag.Terminal_ID = new SelectList(db.Terminals_Arrivals, "Terminal_ID", "Terminals", arrivalsTimeTable.Terminal_ID);
     return(View(arrivalsTimeTable));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "id,FlightNo,FlightID,CityID,Scheduled,StatusID,DepartureTime,Terminal_ID")] DepartureTable departureTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(departureTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FlightID    = new SelectList(db.Airlines, "FlightID", "Flight", departureTable.FlightID);
     ViewBag.CityID      = new SelectList(db.DepartureCities, "CityID", "Cities", departureTable.CityID);
     ViewBag.StatusID    = new SelectList(db.StatusReports, "StatusID", "Status", departureTable.StatusID);
     ViewBag.Terminal_ID = new SelectList(db.TerminalLookUps, "Terminal_ID", "Terminal", departureTable.Terminal_ID);
     return(View(departureTable));
 }