private void cmbPrestation_DropDownClosed(object sender, EventArgs e) { prestation = new PrestationBE(); txtMontant.Text = ""; lblNomPrestation.Content = ""; if (cmbPrestation.SelectedValue != null && cmbPrestation.SelectedValue.ToString() != "" && txtAnneeScolaire.Text != null) { fraisPrestation = prestationBL.obtenirMontantPrestation(cmbPrestation.SelectedValue.ToString(), categorie, annee); if (cmbPrestation.SelectedValue.ToString() != PRESTATION_DEPOT) { prestation.codePrestation = cmbPrestation.SelectedValue.ToString(); prestation = prestationBL.rechercherPrestation(prestation); lblNomPrestation.Content = prestation.nomPrestation; txtMontant.Text = fraisPrestation.ToString(); txtMontant.IsEnabled = false; cmbTranche.IsEnabled = true; checkRemise.IsEnabled = true; } else { cmbTranche.Text = ""; cmbTranche.IsEnabled = false; //checkRemise.IsEnabled = false; txtMontant.IsEnabled = true; } } }
public WindowAddEditPrestationUI() { CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy"; Thread.CurrentThread.CurrentCulture = ci; InitializeComponent(); creerModifierPrestationBL = new CreerModifierPrestationBL(); etat = 0; ancienObjet = new PrestationBE(); // A mettre pour que le binding avec le DataGrid fonctionne ! grdListePrestation.DataContext = this; // Initialisation de la collection, qui va s'afficher dans la DataGrid : ListePrestations = new ObservableCollection <PrestationBE>(); List <PrestationBE> LPrestationBE = creerModifierPrestationBL.listerToutesLesPrestation(); // on met la liste "LPrestationBE" dans le DataGrid RemplirDataGrid(LPrestationBE); }
internal string obtenirNomPrestation(string p) { PrestationBE prestation = new PrestationBE(); prestation.codePrestation = p; prestation = prestationDA.rechercher(prestation); return(prestation.nomPrestation); }
// modifier une Prestation public bool modifierPrestation(PrestationBE p) { if (prestationDA.modifier(p)) { journalDA.journaliser("modification de la prestation de code " + p.codePrestation + ". ancien nom : " + p.nomPrestation + ", nouveau nom : " + p.nomPrestation); return(true); } return(false); }
// modifier une Prestation public bool modifierPrestation(PrestationBE Pre, PrestationBE newPre) { if (prestationDA.modifier(Pre, newPre)) { journalDA.journaliser("modification de la prestation de code " + Pre.codePrestation + ". ancien nom : " + Pre.nomPrestation + ". nouveau code : " + newPre.codePrestation + ", nouveau nom : " + newPre.nomPrestation); return(true); } return(false); }
// supprimer une Prestation public bool supprinerPrestation(PrestationBE Pre) { if (prestationDA.supprimer(Pre)) { journalDA.journaliser("suppression de la prestation de code " + Pre.codePrestation + " et de nom " + Pre.nomPrestation); return(true); } return(false); }
//creer une Prestation public bool creerPrestation(string codeP, string nomP, int priorite) { PrestationBE prestation = new PrestationBE(codeP, nomP, priorite); if (prestationDA.ajouter(prestation)) { journalDA.journaliser("enregistrement d'une prestation de code " + codeP + " et de nom " + nomP); return(true); } return(false); }
private void cmdEnregistrer_Click(object sender, RoutedEventArgs e) { if ((txtCode.Text != null && txtNom.Text != null && txtPriorite.Text != null) && (txtCode.Text != "" && txtNom.Text != "" && txtPriorite.Text != "")) { // si tous les champs sont non vides PrestationBE prestation = new PrestationBE(); prestation.codePrestation = txtCode.Text; prestation.nomPrestation = txtNom.Text; prestation.priorite = Convert.ToInt16(txtPriorite.Text); if (etat == 1) { creerModifierPrestationBL.modifierPrestation(ancienObjet, prestation); List <PrestationBE> LPrestationBE = creerModifierPrestationBL.listerToutesLesPrestation(); // on met la liste "LPrestationBE" dans le DataGrid RemplirDataGrid(LPrestationBE); txtCode.Text = ""; txtNom.Text = ""; txtPriorite.Text = ""; etat = 0; } else if (creerModifierPrestationBL.rechercherPrestation(new PrestationBE(txtCode.Text, txtNom.Text, Convert.ToInt16(txtPriorite.Text))) == null) { // si un cycle possédant le même code n'existe pas deja dans la BD if (creerModifierPrestationBL.creerPrestation(txtCode.Text, txtNom.Text, Convert.ToInt16(txtPriorite.Text))) { // si l'nregistrement a réussi MessageBox.Show("Enregistrement Prestation [" + txtCode.Text + ", " + txtNom.Text + "] " + " : Opération réussie"); txtCode.Text = ""; txtNom.Text = ""; txtPriorite.Text = ""; List <PrestationBE> LPrestationBE = creerModifierPrestationBL.listerToutesLesPrestation(); //on rafraichir le DataGrid RemplirDataGrid(LPrestationBE); } else { MessageBox.Show("Echec enregistrement : une erreure est survenue !"); } } else { MessageBox.Show("Une Prestation ayant le code \"" + txtCode.Text + "\" existe deja dans le système \n \n Veuillez changer de code SVP !"); } } else { MessageBox.Show("Tous les champs doivent pas être remplis !"); } }
public Payer_Prestation() { InitializeComponent(); dpiDateOp.SelectedDate = DateTime.Today; dpiDateOp.IsTodayHighlighted = true; dpiDateOp.Text = DateTime.Now.ToString(); CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy"; Thread.CurrentThread.CurrentCulture = ci; prestationBL = new GestionPrestationBL(); montanttranches = new List <MontantTrancheBE>(); listprestation = new List <string>(); listtranches = new List <string>(); choixDispense = new List <string>() { BOURSE, REMISE }; classes = new List <string>(); eleves = new List <string>(); payers = new List <PayerBE>(); lignes = new List <LignePrestation>(); eleve = new EleveBE(); payer = new PayerBE(); prestation = new PrestationBE(); // fraisInscription = 0; fraisPrestation = 0; totalAPayer = 0; classes = prestationBL.listerValeursColonneClasse("codeclasse"); cmbClasse.ItemsSource = classes; cmbDispense.ItemsSource = choixDispense; annee = prestationBL.AnneeEnCours(); listtranches = prestationBL.listerValeursColonneTranche("codetranche"); cmbTranche.ItemsSource = listtranches; txtAnnee.Text = " / " + annee; txtAnneeScolaire.Text = (annee - 1).ToString(); txtTotal.IsEnabled = false; txtTotalVerse.IsEnabled = false; txtResteAPayer.IsEnabled = false; txtReste.IsEnabled = false; txtRemise.IsEnabled = false; cmbDispense.IsEnabled = false; txtMontant.IsEnabled = false; }
private void grdListePrestation_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (grdListePrestation.SelectedIndex != -1) { etat = 1; PrestationBE prestationBE = new PrestationBE(); prestationBE = creerModifierPrestationBL.rechercherPrestation(ListePrestations.ElementAt(grdListePrestation.SelectedIndex)); if (prestationBE != null) { // on charge les informations dans le formulaire txtCode.Text = prestationBE.codePrestation; txtNom.Text = prestationBE.nomPrestation; txtPriorite.Text = Convert.ToString(prestationBE.priorite); ancienObjet = prestationBE; } grdListePrestation.UnselectAll(); } }
// rechercher une Prestation public PrestationBE rechercherPrestation(PrestationBE p) { return(prestationDA.rechercher(p)); }
internal PrestationBE rechercherPrestation(PrestationBE p) { return(prestationDA.rechercher(p)); }