public ActionResult DeleteConfirmed(int id) { tbl_Flight tbl_Flight = db.tbl_Flight.Find(id); db.tbl_Flight.Remove(tbl_Flight); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Home/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Flight tbl_Flight = db.tbl_Flight.Find(id); if (tbl_Flight == null) { return(HttpNotFound()); } return(View(tbl_Flight)); }
public ActionResult Create([Bind(Include = "idtbl_Flight,FlightNumber,FromCity,ToCity,DepartureDate,ArrivalDate,idtbl_Airplane,idtbl_Company,StopOver,Status,idRoute")] tbl_Flight tbl_Flight) { if (ModelState.IsValid) { db.tbl_Flight.Add(tbl_Flight); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idtbl_Airplane = new SelectList(db.tbl_Airplane, "idtbl_Airplane", "Name", tbl_Flight.idtbl_Airplane); ViewBag.FromCity = new SelectList(db.tbl_Airport, "idtbl_Airport", "Name", tbl_Flight.FromCity); ViewBag.ToCity = new SelectList(db.tbl_Airport, "idtbl_Airport", "Name", tbl_Flight.ToCity); ViewBag.idtbl_Company = new SelectList(db.tbl_Company, "idtbl_Company", "Name", tbl_Flight.idtbl_Company); ViewBag.idRoute = new SelectList(db.tbl_Route, "idRoute", "idRoute", tbl_Flight.idRoute); return(View(tbl_Flight)); }
// GET: Home/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Flight tbl_Flight = db.tbl_Flight.Find(id); if (tbl_Flight == null) { return(HttpNotFound()); } ViewBag.idtbl_Airplane = new SelectList(db.tbl_Airplane, "idtbl_Airplane", "Name", tbl_Flight.idtbl_Airplane); ViewBag.FromCity = new SelectList(db.tbl_Airport, "idtbl_Airport", "Name", tbl_Flight.FromCity); ViewBag.ToCity = new SelectList(db.tbl_Airport, "idtbl_Airport", "Name", tbl_Flight.ToCity); ViewBag.idtbl_Company = new SelectList(db.tbl_Company, "idtbl_Company", "Name", tbl_Flight.idtbl_Company); ViewBag.DepartureDate = new SelectList(db.tbl_Flight, "DepartureDate", "DepartureDate", tbl_Flight.DepartureDate); ViewBag.ArrivalDate = new SelectList(db.tbl_Flight, "ArrivalDate", "ArrivalDate", tbl_Flight.ArrivalDate); ViewBag.idRoute = new SelectList(db.tbl_Route, "idRoute", "idRoute", tbl_Flight.idRoute); return(View(tbl_Flight)); }
public ActionResult IndexA() { tbl_Flight a = new tbl_Flight(); return(View(a.getArrives().ToList())); }
public ActionResult ListVols() { tbl_Flight a = new tbl_Flight(); return(View(a.getAll().ToList())); }
// GET: Home public ActionResult IndexD() { tbl_Flight a = new tbl_Flight(); return(View(a.getDepartures().ToList())); }