private void Classe_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.Classe.Text != "")
     {
         this.Tarif.ItemsSource   = DAL_Tarif.SelectNomTarifsByClasse(DAL_Classe.FindByName(this.Classe.Text).Id);
         this.Tarif.SelectedValue = DAL_Tarif.SelectNomTarifsByClasse(DAL_Classe.FindByName(this.Classe.Text).Id).First();
     }
 }
        private void Nouveau_tarifvol_click(object sender, RoutedEventArgs e)
        {
            float prix;

            if (float.TryParse(Prix.Text, out prix))
            {
                DAL_TarifVol.AjouterTarifVol(DAL_Tarif.FindByNameAndClasse(DAL_Classe.FindByName(Classe.Text).Id, Tarif.Text).Id, vol, prix);
                AfficherTarifVol();
            }
        }
        public TarifVolPage(int _vol)
        {
            vol = _vol;
            InitializeComponent();
            AfficherTarifVol();

            this.Classe.ItemsSource   = DAL_Classe.SelectNomClasses();
            this.Classe.SelectedValue = DAL_Classe.SelectNomClasses().First();

            this.Tarif.ItemsSource   = DAL_Tarif.SelectNomTarifsByClasse(DAL_Classe.FindByName(this.Classe.Text).Id);
            this.Tarif.SelectedValue = DAL_Tarif.SelectNomTarifsByClasse(DAL_Classe.FindByName(this.Classe.Text).Id).First();
        }
        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);
        }