コード例 #1
0
        public static List <Vol> GetVols(DateTime departureDate, String departureCity, String arrivalCity)
        {
            DALVols    dalVols = new DALVols();
            List <Vol> vols    = DataSetToVols(dalVols.GetVolsByDepartureDateDepartureCityArrivalCity(departureDate, departureCity, arrivalCity));

            return(vols);
        }
コード例 #2
0
        public static Vol GetVolById(int id)
        {
            DALVols    dalVols = new DALVols();
            DataSet    result  = dalVols.GetVolById(id);
            List <Vol> vols    = DataSetToVols(result);

            return(vols[0]);
        }
コード例 #3
0
        public static Boolean reserver(int idVol, int nbSeats)
        {
            DALVols dalVols = new DALVols();

            if (Convert.ToInt32(dalVols.GetVolCapacityById(idVol).Tables[0].Rows[0]["CAPACITY"].ToString()) > nbSeats)
            {
                dalVols.DecrementVolSeatsById(idVol, nbSeats);
                return(true);
            }
            return(false);
        }
コード例 #4
0
        /**
         * Renvoie la liste des couples (ville de départ, villes d'arrivée)
         */
        public static Dictionary <string, List <string> > GetFlightCities()
        {
            DALVols    dalVols = new DALVols();
            List <Vol> vols    = DataSetToVols(dalVols.GetVols());

            Dictionary <string, List <string> > travels = new Dictionary <string, List <string> >();
            List <string> cities = new List <string>();

            foreach (Vol v in vols)
            {
                if (!cities.Contains(v.DepartureCity))
                {
                    cities.Add(v.DepartureCity);
                }
            }

            cities.ForEach(city =>
            {
                travels.Add(city, vols.FindAll(v => v.DepartureCity == city).ConvertAll(v => v.ArrivalCity));
            });

            return(travels);
        }
コード例 #5
0
 public static DataSet GetCaTrancheVol(int idPlan)
 {
     return(DALVols.GetCaTrancheVol(idPlan));
 }
コード例 #6
0
 public static void GetStatsVol(int idVol, int idPlan, out int nbPassagers, out int nbPlacesDisp, out decimal tauxOqp, out decimal ca)
 {
     DALVols.GetStatsVol(idVol, idPlan, out nbPassagers, out nbPlacesDisp, out tauxOqp, out ca);
 }
コード例 #7
0
 public static DataSet GetInfosFiltre(string filter)
 {
     return(DALVols.GetInfosFiltre(filter));
 }
コード例 #8
0
 public static List <Models.Vol> GetTousVols()
 {
     return(DALVols.GetAllVols());
 }
コード例 #9
0
 // Admin
 public static DataSet GetInfos()
 {
     return(DALVols.GetInfos());
 }
コード例 #10
0
        public static void AddReservationVol(int idVol, int nbSeats, string nom, string prenom)
        {
            DALVols dalVols = new DALVols();

            dalVols.AddReservationVol(nom, prenom, nbSeats, idVol);
        }