public ActionResult Create(Ticket ticket)
        {
            if (ModelState.IsValid)
            {
                db.Tickets.Add(ticket);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.FlightID = new SelectList(db.Flights, "FlightID", "FlightID", ticket.FlightID);
            ViewBag.PassengerID = new SelectList(db.Passengers, "PassengerID", "Name", ticket.PassengerID);
            return View(ticket);
        }
 public ActionResult Edit(Ticket ticket)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ticket).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.FlightID = new SelectList(db.Flights, "FlightID", "FlightID", ticket.FlightID);
     ViewBag.PassengerID = new SelectList(db.Passengers, "PassengerID", "Name", ticket.PassengerID);
     return View(ticket);
 }