private void cmbArticle_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CultureInfo elGR = CultureInfo.CreateSpecificCulture("el-GR");

            if (cmbArticle.SelectedValue != null)
            {
                setarticle = new SetarticleBE();
                setarticle.codesetarticle = cmbArticle.SelectedValue.ToString();
                setarticle         = articleBL.rechercherSetArticle(setarticle);
                lblMontant.Content = setarticle.montant.ToString("0,0", elGR);
            }
        }
 private void grdListePaiement_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Delete)
     {
         if (MessageBox.Show("Voulez vous supprimer?", "School : Confirmation", System.Windows.MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             if (grdListePaiement.SelectedIndex != -1)
             {
                 AcheterBE    acheter    = new AcheterBE();
                 SetarticleBE setarticle = new SetarticleBE();
                 acheter = acheters.ElementAt(grdListePaiement.SelectedIndex);
                 setarticle.codesetarticle = acheter.codesetarticle;
                 setarticle = articleBL.rechercherSetArticle(setarticle);
                 articleBL.incrementerStock(setarticle, acheter.quantite, annee);
                 acheters.Remove(acheter);
                 articleBL.supprimerAcheter(acheter);
                 grdListePaiement.ItemsSource = acheters;
                 grdListePaiement.Items.Refresh();
             }
             else
             {
                 MessageBox.Show("Aucune ligne sélectionnée", "School brain:Alerte");
             }
         }
     }
 }
        private void cmbEleve_DropDownClosed(object sender, EventArgs e)
        {
            if (cmbEleve.Text != null && cmbEleve.Text != "")
            {
                string nommat = cmbEleve.Text;
                txtMatricule.Text = nommat.Split('-')[0].Trim();

                acheters          = new List <AcheterBE>();
                achats_setarticle = new List <string>();
                acheters          = articleBL.listerSuivantCritereAcheters(" matricule = " + "'" + txtMatricule.Text + "' AND annee = " + "'" + annee + "'");
                if (acheters != null && acheters.Count > 0)
                {
                    foreach (AcheterBE a in acheters)
                    {
                        achats_setarticle.Add(a.codesetarticle);
                    }
                    cmbArticle.ItemsSource = achats_setarticle;
                    cmbArticle.Items.Refresh();
                    cmbArticle.SelectedIndex = 0;

                    setarticle = new SetarticleBE();
                    setarticle.codesetarticle = achats_setarticle.ElementAt(0);
                    setarticle = articleBL.rechercherSetArticle(setarticle);
                    lblNomSetArticle.Content = setarticle.nomsetarticle;
                    lblPrix.Content          = setarticle.montant.ToString();
                    txtQuantite.Text         = acheters.ElementAt(0).quantite.ToString();

                    lignesStockerDuneVente();
                }
                else
                {
                    achats_setarticle      = new List <string>();
                    cmbArticle.Text        = "";
                    cmbArticle.ItemsSource = achats_setarticle;
                    cmbArticle.Items.Refresh();
                    lblNomSetArticle.Content = "";
                    lblPrix.Content          = "";
                    txtQuantite.Text         = "";
                    ListeArticles2.Clear();
                    grdListeArticle2.ItemsSource = ListeArticles2;
                    RemplirDataGrid1(LArticleBE);
                }
            }
        }