public List<t_flightmatching> addList(string flightDepartureSelectionne, string flightArrivalSelectionne, t_flightmatching flight)
        {
            /* flight flt = unitOfWork.FlightRepository.GetById(idFlight);
             flt.idStaff = stf.id;
             unitOfWork.FlightRepository.Update(flt);
             unitOfWork.Commit();*/

            //    string dep = flightDepartureSelectionne.departure;
            //    string arr = flightArrivalSelectionne.arrival;
            string dateDep = flight.dateFlightMatchingDep;
            string dateArr = flight.dateFlightMatchingArr;

            List<t_flightmatching> listeAmaj = new List<t_flightmatching>();
            List<t_flightmatching> listeTsLesFlights = utwk.FlightMatchingRepository.GetAll().ToList();

            foreach (t_flightmatching f in listeTsLesFlights)
            {
                // if (f.departure == dep && f.arrival == arr && f.dateFlightMatchingDep == dateDep && f.dateFlightMatchingArr == dateArr)
                if (f.departure == flightDepartureSelectionne && f.arrival == flightArrivalSelectionne)

                {
                    listeAmaj.Add(f);

                }
            }

            return listeAmaj;

            //return utwk.FlightMatchingRepository.GetAll().ToList();
        }
        public ActionResult Create(t_flightmatching flightMatching)
        {
            if (ModelState.IsValid)
            {

                flightMatchingService.AddFlightMatching(flightMatching);
                return RedirectToAction("Index");
            }

            return View();
        }
        public ActionResult Add(t_flightmatching flightMatching)
        {
            if (ModelState.IsValid)
            {

              /* airline
             arrivalDate
             arrivalLocation
             departureDate
             departureLocation
             nbSits
             numFlight
             price
             timeFlightMatchingArr
             timeFlightMatchingDep
              patient_userId
              */

                t_flight myFlight = new t_flight();
                myFlight.patient_userId = patientId;

                myFlight.arrivalDate = flightMatching.dateFlightMatchingArr;
                myFlight.arrivalLocation = flightMatching.arrival;
                myFlight.timeFlightMatchingArr = flightMatching.timeFlightMatchingArr;

                myFlight.departureDate = flightMatching.dateFlightMatchingDep;
                myFlight.departureLocation = flightMatching.departure;
                myFlight.timeFlightMatchingDep = flightMatching.timeFlightMatchingDep;

                myFlight.airline = flightMatching.airline;
                myFlight.numFlight = flightMatching.numFlight;
                myFlight.price = flightMatching.price;
                myFlight.nbSits = 1;

                flightService.AddFlight(myFlight);

                return RedirectToAction("IndexOfMYflights");
            }
            else
            {
                return View();
            }
        }
 public ActionResult Add2Affichage(t_flightmatching myFlights)
 {
     return View(myFlights);
 }
        public ActionResult AddFlight1(string MyListDeparture, string MyListArrival, t_flightmatching flight)
        {
            t_flightmatching flightDepartureSelectionne = flightMatchingService.GetById(Int32.Parse(MyListDeparture));
            t_flightmatching flightArrivalSelectionne = flightMatchingService.GetById(Int32.Parse(MyListArrival));

            if (ModelState.IsValid)
            {
                // flightService.assignStaffToFlight(flightDepartureSelectionne, flightArrivalSelectionne,flight);
                var myFlights = flightMatchingService.addList(MyListDeparture, MyListArrival, flight);
                //return View(myFlights);

                //  return RedirectToAction("Index");
                return RedirectToAction("Add2Affichage", new { t_flightmatching = myFlights });
            }

            else
            {
                return View();
            }
        }
 public void DeleteFlightMatching(t_flightmatching t)
 {
     utwk.FlightMatchingRepository.Delete(t);
     utwk.Commit();
 }
 public void AddFlightMatching(t_flightmatching tf)
 {
     utwk.FlightMatchingRepository.Add(tf);
     utwk.Commit();
 }
        public ActionResult Edit(t_flightmatching flightMatching)
        {
            if (ModelState.IsValid)
            {
                flightMatchingService.UpdateFlightMatching(flightMatching);

                return RedirectToAction("Index");
            }
            else
            {
                return View();
            }
        }