public FlightService() { dbFactory= new DatabaseFactory(); utwk= new UnitOfWork(dbFactory); ctx = new medtravdbContext(); }
public ActionResult Ajout2() { //, SelectList MyDrownDown1, SelectList MyDrownDown2 medtravdbContext db = new medtravdbContext(); ViewBag.DropDownValuesDeparture = new SelectList(db.t_flightmatching, "idFlightMatching", "departure"); ViewBag.DropDownValuesArrival = new SelectList(db.t_flightmatching, "idFlightMatching", "arrival"); //POUR LES DOUBLONS ET L'ORDRE NON ALPHABETIQUE : ?! //ViewBag.DropDownValues = new SelectList(db.t_flightmatching, "idFlightMatching", "departure").Distinct() //db.t_flightmatching.OrderBy(t => t.departure).ToList(); /* String dep1 = MyDrownDown1.SelectedValue.ToString(); String dep2 = MyDrownDown2.SelectedValue.ToString(); flight.departureLocation = dep1; flight.arrivalLocation = dep2; */ //if (ModelState.IsValid) // { // /* // if (!String.IsNullOrEmpty(flight.departureLocation.ToString() && flight.arrivalLocation && flight.departureDate && flight.arrivalDate)) // { // movies = movies.Where(m => m.Genre.Contains(searchString)).ToList(); // } // */ // flightService.AddFlight(flight); // return RedirectToAction("Index"); // } // else // { // return View(); // } return View(); }
public DatabaseFactory() { dataContext = new medtravdbContext(); }