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); }
public static Vol GetVolById(int id) { DALVols dalVols = new DALVols(); DataSet result = dalVols.GetVolById(id); List <Vol> vols = DataSetToVols(result); return(vols[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); }
/** * 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); }
public static DataSet GetCaTrancheVol(int idPlan) { return(DALVols.GetCaTrancheVol(idPlan)); }
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); }
public static DataSet GetInfosFiltre(string filter) { return(DALVols.GetInfosFiltre(filter)); }
public static List <Models.Vol> GetTousVols() { return(DALVols.GetAllVols()); }
// Admin public static DataSet GetInfos() { return(DALVols.GetInfos()); }
public static void AddReservationVol(int idVol, int nbSeats, string nom, string prenom) { DALVols dalVols = new DALVols(); dalVols.AddReservationVol(nom, prenom, nbSeats, idVol); }