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();
            }
        }
Ejemplo n.º 2
0
        public t_flight GetMYflightDetails(int id, int patientId)
        {
            List<t_flight> listeTsLesFlights = utwk.FlightRepository.GetAll().ToList();
            t_flight myFlightFound = new t_flight();

            foreach (t_flight f in listeTsLesFlights)
            {

                if (f.flightId == id && f.patient_userId == patientId)

                {
                    myFlightFound = f;

                }
            }

            return myFlightFound;
        }
Ejemplo n.º 3
0
 public void AddFlight(t_flight f)
 {
     utwk.FlightRepository.Add(f);
     utwk.Commit();
 }
Ejemplo n.º 4
0
 public void DeleteFlight(t_flight t)
 {
     utwk.FlightRepository.Delete(t);
     utwk.Commit();
 }
Ejemplo n.º 5
0
 public void UpdateFlight(t_flight t)
 {
     utwk.FlightRepository.Update(t);
     utwk.Commit();
 }