public AnnulationVenteUI() { InitializeComponent(); eleves = new List <string>(); classes = new List <string>(); articleBL = new GestionArticleBL(); dpiDate.SelectedDate = DateTime.Today; dpiDate.IsTodayHighlighted = true; dpiDate.Text = DateTime.Now.ToString(); CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd"; Thread.CurrentThread.CurrentCulture = ci; classes = articleBL.listerValeurColonneClasse("codeclasse"); cmbClasse.ItemsSource = classes; eleve = new EleveBE(); annee = articleBL.anneeEnCours(); acheters = articleBL.listerSuivantCritereAcheters("annee = " + "'" + annee + "'"); txtAnnee.Text = " / " + annee; txtAnneeScolaire.Text = (annee - 1).ToString(); grdListePaiement.ItemsSource = acheters; }
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); } } }
private void rechargerGrid() { txtMatricule2.Text = ""; txtMatricule.Text = ""; cmbEleve.Text = ""; dpiDate.Text = ""; dpiDate.SelectedDate = null; acheters = articleBL.listerSuivantCritereAcheters("annee = " + "'" + annee + "'"); grdListePaiement.ItemsSource = acheters; grdListePaiement.Items.Refresh(); }
public VenteArticleUI() { InitializeComponent(); listSet = new List <string>(); listSet2 = new List <string>(); eleves = new List <string>(); classes = new List <string>(); articleBL = new GestionArticleBL(); dpiDate.SelectedDate = DateTime.Today; dpiDate.IsTodayHighlighted = true; dpiDate.Text = DateTime.Now.ToString(); dpiDateOp.SelectedDate = DateTime.Today; dpiDateOp.IsTodayHighlighted = true; dpiDateOp.Text = DateTime.Now.ToString(); CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd"; Thread.CurrentThread.CurrentCulture = ci; ancien_acheter = new AcheterBE(); classes = articleBL.listerValeurColonneClasse("codeclasse"); cmbClasse.ItemsSource = classes; typeValidation = "enregistrer"; acheters = articleBL.listerSuivantCritereAcheters("dateachat = " + "'" + DateTime.Today.Date.ToShortDateString() + "'"); setarticle = new SetarticleBE(); eleve = new EleveBE(); listSet = articleBL.listerValeursColonneSetArticle("codesetarticle"); listSet2 = articleBL.listerValeursColonneSetArticle("codesetarticle"); listSet2.Add(TOUT); cmbArticle.ItemsSource = listSet; cmbArticle2.ItemsSource = listSet2; annee = articleBL.anneeEnCours(); txtAnnee.Text = " / " + annee; txtAnneeScolaire.Text = (annee - 1).ToString(); grdListePaiement.ItemsSource = acheters; }