コード例 #1
0
        public ActionResult Create([Bind(Include = "CityID,Cities")] City city)
        {
            if (ModelState.IsValid)
            {
                db.Cities.Add(city);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(city));
        }
        public ActionResult Create([Bind(Include = "FlightID,Flight")] Airlines_Arrivals airlines_Arrivals)
        {
            if (ModelState.IsValid)
            {
                db.Airlines_Arrivals.Add(airlines_Arrivals);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(airlines_Arrivals));
        }
        public ActionResult Create([Bind(Include = "Id,FlightNo,FlightID,CityID,Scheduled,StatusID,ArrivalTime,Terminal_ID")] ArrivalsTimeTable arrivalsTimeTable)
        {
            if (ModelState.IsValid)
            {
                db.ArrivalsTimeTables.Add(arrivalsTimeTable);
                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 Create([Bind(Include = "id,FlightNo,FlightID,CityID,Scheduled,StatusID,DepartureTime,Terminal_ID")] DepartureTable departureTable)
        {
            if (ModelState.IsValid)
            {
                db.DepartureTables.Add(departureTable);
                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));
        }