public Billet(int _id, int _client, int _vol, DateTime _date) { this.id = _id; this.client = _client; Tarif.Tarif t = DAL_Tarif.GetTarif(DAL_TarifVol.GetTarifVol(_vol).Tarif); this.classe = DAL_Classe.GetClasse(t.Classe).Nom; this.tarif = t.Nom; this.prix = DAL_TarifVol.GetTarifVol(_vol).Prix; Vol.Vol vol = DAL_Vol.GetVol(DAL_TarifVol.GetTarifVol(_vol).Vol); this.trajet = vol.StrTrajet; this.depart = vol.Depart; this.arrivee = vol.Arrivee; this.date = _date; }
public static List <string> SelectNomTarifsWithClasse() { List <string> Tarifs = new List <string>(); bdd.OpenConnection(); string query = "SELECT * FROM tarif;"; MySqlCommand cmd = new MySqlCommand(query, bdd.GetConnection()); cmd.ExecuteNonQuery(); MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Tarif Tarif = new Tarif(reader.GetInt32(0), reader.GetInt32(1), reader.GetString(2)); Tarifs.Add(DAL_Classe.GetClasse(Tarif.Classe) + " - " + Tarif.Nom); } reader.Close(); bdd.CloseConnection(); return(Tarifs); }