private void btnChoisirBeneficiaire_Click(object sender, EventArgs e) { if (IdService < 0) { Journal.AfficherMessage("La table des services est inexistante ou corrompue. L'action a été annulée.", TypeMessage.ERREUR, true); return; } if (IdStatut < 0) { Journal.AfficherMessage("La table des statuts est inexistante ou corrompue. L'action a été annulée.", TypeMessage.ERREUR, true); return; } Table beneficiaires = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("Beneficiaire", String.Format(RequeteBeneficiaire, IdStatut, IdService)); frmSelectionTable choixBeneficiaire = new frmSelectionTable("Choisir un bénéficiaire...", beneficiaires, new List <string> { "perNom", "perPrenom", "perDateNaissance" }, "perId"); if (choixBeneficiaire.AfficherDialogue(this)) { BeneficiaireCourant = choixBeneficiaire.LigneChoisie; lblNomValeur.Text = choixBeneficiaire.LigneChoisie.GetValeurChamp <string>("perNom"); lblPrenomValeur.Text = choixBeneficiaire.LigneChoisie.GetValeurChamp <string>("perPrenom"); ChargerLivraisons(); } mcCalendrier.Enabled = gbGestionLivraisons.Enabled = btnInscription.Enabled = BeneficiaireCourant != null; }
private void gtBeneficiaires_RowDoubleClick(object sender, Outils.RowDoubleClickEventArgs e) { Champ indexBeneficiaire = e.LigneCliquee.GetChamp("perId"); LigneTable action = ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value); string infosBeneficiaire = String.Format(FORMAT_BENEFICIAIRES_INCLUS, e.LigneCliquee.GetValeurChamp <string>("perNom"), e.LigneCliquee.GetValeurChamp <string>("perPrenom")); RequeteSelection reqSel = new RequeteSelection(NomTable.beneficiaireactionactivite); reqSel.Condition = new ConditionRequete(Operateur.EGAL, indexBeneficiaire); reqSel.Condition.LierCondition(new ConditionRequete(Operateur.EGAL, action.GetChamp("actaId")), true); if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel).EstVide) { Journal.AfficherMessage("Ce bénéficiaire fait déjà partie de cette action.", TypeMessage.INFORMATION, false); return; } RequeteAjout reqAjout = new RequeteAjout(NomTable.beneficiaireactionactivite, indexBeneficiaire, action.GetChamp("actaId")); if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0) { Journal.AfficherMessage("Une erreur est survenue lors de l'ajout du bénéficiaire à l'action. L'action a été annulée.", TypeMessage.ERREUR, true); return; } AjouterItem(lbBeneficiairesInclus, new ComboBoxItem(infosBeneficiaire, indexBeneficiaire)); }
private void ChargerAction() { LigneTable action = ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value); int indexAction = action.GetValeurChamp <int>("actaId"); dtpDate.Value = action.GetValeurChamp <DateTime>("actaDate"); nudBenevolesNonInscrits.Value = action.GetValeurChamp <int>("actaNbBenevolesNonInscrits"); Table benevolesInclus = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("benevoleactionactivite", String.Format(REQUETE_BENEVOLES_INCLUS, indexAction)); List <ComboBoxItem> listeBenevolesInclus = new List <ComboBoxItem>(); foreach (LigneTable l in benevolesInclus.Lignes) { string infosBenevole = String.Format(FORMAT_BENEVOLES_INCLUS, l.GetValeurChamp <string>("perNom"), l.GetValeurChamp <string>("perPrenom"), l.GetValeurChamp <int>("benaHeures")); listeBenevolesInclus.Add(new ComboBoxItem(infosBenevole, l.GetChamp("perId"))); } MettreAJourListe(lbBenevolesInclus, listeBenevolesInclus); Table beneficiairesInclus = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("beneficiaireactionactivite", String.Format(REQUETE_BENEFICIAIRES_INCLUS, indexAction)); List <ComboBoxItem> listeBeneficiairesInclus = new List <ComboBoxItem>(); foreach (LigneTable l in beneficiairesInclus.Lignes) { string infosBeneficiaire = String.Format(FORMAT_BENEFICIAIRES_INCLUS, l.GetValeurChamp <string>("perNom"), l.GetValeurChamp <string>("perPrenom")); listeBeneficiairesInclus.Add(new ComboBoxItem(infosBeneficiaire, l.GetChamp("perId"))); } MettreAJourListe(lbBeneficiairesInclus, listeBeneficiairesInclus); }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is int) { IndexBeneficiaireCourant = (int)messages[0]; RequeteSelection reqSel = new RequeteSelection(NomTable.inscriptiontransportaccompagement); reqSel.Condition = new ConditionRequete(Operateur.EGAL, "perId", IndexBeneficiaireCourant.ToString()); Table inscriptionLifeline = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel); if (!inscriptionLifeline.EstVide) { LigneTable infosInscription = inscriptionLifeline.Lignes[0]; txtNoDossierCLE.Text = infosInscription.GetValeurChamp <string>("itaNoDossierCLE").ToString(); txtNoDossierCSST.Text = infosInscription.GetValeurChamp <string>("itaNoDossierCSST").ToString(); txtNomAgent.Text = infosInscription.GetValeurChamp <string>("itaNomAgentCSST"); txtPrenomAgent.Text = infosInscription.GetValeurChamp <string>("itaPrenomAgentCSST"); mtxtTelephoneAgent.Text = infosInscription.GetValeurChamp <string>("itaTelephoneAgentCSST"); txtMobiliteReduite.Text = infosInscription.GetValeurChamp <string>("itaMobiliteReduite"); txtCapaciteAuditive.Text = infosInscription.GetValeurChamp <string>("itaCapaciteAuditive"); txtCapaciteVisuelle.Text = infosInscription.GetValeurChamp <string>("itaCapaciteVisuelle"); txtMemoire.Text = infosInscription.GetValeurChamp <string>("itaMemoire"); cbVuDDN.Checked = infosInscription.GetValeurChamp <bool>("itaVuDDN"); } else { Vider(); } } }
private void GenererFeuille(Table beneficiaires, string nomRoute, Table sommaireLivraisons, Classeur document) { if (beneficiaires.EstVide) { return; } int totalNbRepas = 0; beneficiaires.Lignes.ForEach(l => { int nbRepas = l.GetValeurChamp <int>("lprNombreRepas"); decimal prixRepas = l.GetValeurChamp <decimal>("lprPrixRepas"); totalNbRepas += nbRepas; //l.AjouterChamp("lprTransaction", (decimal)(nbRepas * prixRepas), "iprIndicationsLivraison"); //Enlever à la demande du CABS int noAppart = l.GetValeurChamp <int>("perNoAppart"); l.RetirerChamp("perNoAppart"); if (noAppart > 0) { l.GetChamp("perRue").Valeur = l.GetValeurChamp <string>("perRue") + " #" + noAppart; } }); beneficiaires.RetirerChamp("lprPrixRepas"); Feuille nouvelleFeuille = new Feuille(nomRoute, 2); nouvelleFeuille.AjouterTableau(new Tableau(beneficiaires, 120, 28)); if (cbSommaireRoute.Checked) { LigneTable ligneSommaire = new LigneTable("Sommaire de la route"); ligneSommaire.AjouterChamp("Total à livrer", totalNbRepas); ligneSommaire.AjouterChamp("Total livrés", ""); Table sommaireRoute = new Table("Sommaire de la route"); sommaireRoute.AjouterLigne(ligneSommaire); nouvelleFeuille.AjouterTableau(new Tableau(sommaireRoute, 0, 28)); } if (cbSommaireLivraisons.Checked) { LigneTable ligneSommaireLivraisons = new LigneTable("Sommaire des livraisons"); ligneSommaireLivraisons.AjouterChamp("Route", nomRoute); ligneSommaireLivraisons.AjouterChamp("Total à livrer", totalNbRepas); ligneSommaireLivraisons.AjouterChamp("Total livrés", ""); sommaireLivraisons.AjouterLigne(ligneSommaireLivraisons); } if (cbDetailRoute.Checked) { document.AjouterFeuille(nouvelleFeuille); } }
private void ChargerReunion() { LigneTable reunion = ((LigneTable)((ComboBoxItem)cmbReunion.SelectedItem).Value); int indexReunion = reunion.GetValeurChamp <int>("reuId"); dtpDate.Value = reunion.GetValeurChamp <DateTime>("reuDate"); txtDescription.Text = reunion.GetValeurChamp <string>("reuDescription"); Table benevolesInclus = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("benevolereunion", String.Format(REQUETE_BENEVOLES_INCLUS, indexReunion)); List <ComboBoxItem> listeBenevolesInclus = new List <ComboBoxItem>(); foreach (LigneTable l in benevolesInclus.Lignes) { string infosBenevole = String.Format(FORMAT_PERSONNES_INCLUS, l.GetValeurChamp <string>("perNom"), l.GetValeurChamp <string>("perPrenom"), l.GetValeurChamp <int>("benrHeures")); listeBenevolesInclus.Add(new ComboBoxItem(infosBenevole, l.GetChamp("perId"))); } MettreAJourListe(lbBenevolesInclus, listeBenevolesInclus); Table employesInclus = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("employereunion", String.Format(REQUETE_EMPLOYES_INCLUS, indexReunion)); List <ComboBoxItem> listeEmployesInclus = new List <ComboBoxItem>(); foreach (LigneTable l in employesInclus.Lignes) { string infosBeneficiaire = String.Format(FORMAT_PERSONNES_INCLUS, l.GetValeurChamp <string>("perNom"), l.GetValeurChamp <string>("perPrenom"), l.GetValeurChamp <int>("erHeures")); listeEmployesInclus.Add(new ComboBoxItem(infosBeneficiaire, l.GetChamp("perId"))); } MettreAJourListe(lbEmployesInclus, listeEmployesInclus); }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is int) { IndexBeneficiaireCourant = (int)messages[0]; RequeteSelection reqSel = new RequeteSelection(NomTable.inscriptionclubmarche); reqSel.Condition = new ConditionRequete(Operateur.EGAL, "perId", IndexBeneficiaireCourant.ToString()); Table inscriptionClubMarche = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel); if (!inscriptionClubMarche.EstVide) { LigneTable infosInscription = inscriptionClubMarche.Lignes[0]; rbProblemeCardiaqueOui.Checked = infosInscription.GetValeurChamp <bool>("icmProblemeCardiaque"); rbDouleurPoitrineOui.Checked = infosInscription.GetValeurChamp <bool>("icmDouleurPoitrine"); rbProblemesOsseuxOui.Checked = infosInscription.GetValeurChamp <bool>("icmProblemesOsseux"); rbRestrictionPhysiqueOui.Checked = infosInscription.GetValeurChamp <bool>("icmRestrictionPhysique"); txtRestrictionPhysiqueSpecifier.Text = infosInscription.GetValeurChamp <string>("icmDetailsRestrictionPhysique"); rbProblemeSanteOui.Checked = infosInscription.GetValeurChamp <bool>("icmProblemeSante"); txtProblemeSanteSpecifier.Text = infosInscription.GetValeurChamp <string>("icmDetailsProblemeSante"); } else { Vider(); } } }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is int) { IndexBeneficiaireCourant = (int)messages[0]; RequeteSelection reqSel = new RequeteSelection(NomTable.inscriptionvisitesamitie); reqSel.Condition = new ConditionRequete(Operateur.EGAL, "perId", IndexBeneficiaireCourant.ToString()); Table inscriptionLifeline = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel); if (!inscriptionLifeline.EstVide) { LigneTable infosInscription = inscriptionLifeline.Lignes[0]; txtMobiliteReduite.Text = infosInscription.GetValeurChamp <string>("ivaMobiliteReduite"); txtCapaciteAuditive.Text = infosInscription.GetValeurChamp <string>("ivaCapaciteAuditive"); txtCapaciteVisuelle.Text = infosInscription.GetValeurChamp <string>("ivaCapaciteVisuelle"); txtMemoire.Text = infosInscription.GetValeurChamp <string>("ivaMemoire"); } else { Vider(); } } }
private void gtEmployes_RowDoubleClick(object sender, RowDoubleClickEventArgs e) { Champ indexEmploye = e.LigneCliquee.GetChamp("perId"); Champ nombreHeures = new Champ("employereunion", "erHeures", (int)nudNombreHeuresEmploye.Value); LigneTable reunion = ((LigneTable)((ComboBoxItem)cmbReunion.SelectedItem).Value); string infosEmploye = String.Format(FORMAT_PERSONNES_INCLUS, e.LigneCliquee.GetValeurChamp <string>("perNom"), e.LigneCliquee.GetValeurChamp <string>("perPrenom"), nombreHeures.Valeur); RequeteSelection reqSel = new RequeteSelection(NomTable.employereunion); reqSel.Condition = new ConditionRequete(Operateur.EGAL, indexEmploye); reqSel.Condition.LierCondition(new ConditionRequete(Operateur.EGAL, reunion.GetChamp("reuId")), true); if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel).EstVide) { Journal.AfficherMessage("Cet employé fait déjà partie de cette réunion. Retirez-le préalablement pour modifier son nombre d'heures.", TypeMessage.INFORMATION, false); return; } RequeteAjout reqAjout = new RequeteAjout(NomTable.employereunion, indexEmploye, reunion.GetChamp("reuId"), nombreHeures); if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0) { Journal.AfficherMessage("Une erreur est survenue lors de l'ajout de l'employé à la réunion. L'action a été annulée.", TypeMessage.ERREUR, true); return; } AjouterItem(lbEmployesInclus, new ComboBoxItem(infosEmploye, indexEmploye)); }
private void btnRetirer_Click(object sender, EventArgs e) { TreeNode noeudBeneficiaire = tvRoutesBeneficiaires.SelectedNode; TreeNode noeudRoute = noeudBeneficiaire.Parent; if (noeudBeneficiaire == null || noeudRoute == null) { Journal.EcrireMessage("frmGestionRoutes : Bouton Retirer enabled sans devoir l'être"); return; } LigneTable beneficiaire = noeudBeneficiaire.Tag is LigneTable ? (LigneTable)noeudBeneficiaire.Tag : new LigneTable("beneficiaire"); ConditionRequete cond = new ConditionRequete(Operateur.EGAL, "perId", beneficiaire.GetChamp("perId").ValeurSQL); cond.LierCondition(new ConditionRequete(Operateur.EGAL, "rprId", noeudRoute.Tag.ToString()), true); RequeteSuppression reqSup = new RequeteSuppression(NomTable.beneficiaireroutepopoteroulante, cond); if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0) { Journal.AfficherMessage("Une erreur est survenue lors du retirement du bénéficiaire de la route. L'action a été annulée.", TypeMessage.ERREUR, true); return; } noeudRoute.Nodes.Remove(noeudBeneficiaire); tvRoutesBeneficiaires_AfterSelect(tvRoutesBeneficiaires, new TreeViewEventArgs(noeudRoute)); lbBeneficiaires.Items.Add(new ComboBoxItem(noeudBeneficiaire.Text, beneficiaire)); }
public override bool Enregistrer() { if (!base.Enregistrer()) { return(false); } PersonneCourante.AjouterChamp("perDateDerniereMaj", DateTime.Now); Champ indexPersonne = PersonneCourante.GetChamp("perId"); LigneTable personne = new LigneTable("Personne"); personne.AjouterChamp("perDateDerniereMaj", PersonneCourante.GetValeurChamp <DateTime>("perDateDerniereMaj")); personne.AjouterChamp("perDateOuverture", PersonneCourante.GetValeurChamp <DateTime>("perDateOuverture")); personne.AjouterChamp("perDateFermeture", PersonneCourante.GetValeurChamp <DateTime>("perDateFermeture")); personne.AjouterChamp("perDateInactivite", PersonneCourante.GetValeurChamp <DateTime>("perDateInactivite")); personne.AjouterChamp("staId", PersonneCourante.GetValeurChamp <int>("staId")); RequeteModification reqModif = new RequeteModification(NomTable.personne, new ConditionRequete(Operateur.EGAL, indexPersonne), personne); if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) <= 0) { return(false); } return(true); }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is int) { IndexBeneficiaireCourant = (int)messages[0]; RequeteSelection reqSel = new RequeteSelection(NomTable.inscriptionpopoteroulante); reqSel.Condition = new ConditionRequete(Operateur.EGAL, "perId", IndexBeneficiaireCourant.ToString()); Table inscriptionPopote = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel); if (!inscriptionPopote.EstVide) { LigneTable infosInscription = inscriptionPopote.Lignes[0]; nudSolde.Value = infosInscription.GetValeurChamp <decimal>("iprSolde"); cbDiabetique.Checked = infosInscription.GetValeurChamp <bool>("iprDiabetique"); cbConjointDiabetique.Checked = infosInscription.GetValeurChamp <bool>("iprConjointDiabetique"); txtAllergies.Text = infosInscription.GetValeurChamp <string>("iprListeAllergies"); txtAllergiesConjoint.Text = infosInscription.GetValeurChamp <string>("iprListeAllergiesConjoint"); txtIndicationsLivraison.Text = infosInscription.GetValeurChamp <string>("iprIndicationsLivraison"); } else { Vider(); } } }
public override bool Supprimer() { if (!base.Supprimer()) { return(false); } if (!OutilsForms.PoserQuestion("Confirmation suppression", "Voulez-vous vraiment supprimer cette action?")) { return(false); } LigneTable action = ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value); RequeteSuppression reqSup = new RequeteSuppression(NomTable.actionactivite, new ConditionRequete(Operateur.EGAL, action.GetChamp("actaId"))); if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0) { Journal.AfficherMessage("Une erreur est survenue lors de la suppression de l'action. L'action a été annulée.", TypeMessage.ERREUR, true); return(false); } cmbAction.Items.Remove(cmbAction.SelectedItem); if (cmbAction.Items.Count > 0) { cmbAction.SelectedIndex = 0; } return(true); }
private void ViderDonneesCouple() { PersonneCouple = null; IndexPersonneCouple = 0; lblNomCouple.ResetText(); lblPrenomCouple.ResetText(); }
private void RemplirDonneesCouple(LigneTable personneCouple) { PersonneCouple = personneCouple; IndexPersonneCouple = personneCouple.GetValeurChamp <int>("perId"); lblNomCouple.Text = personneCouple.GetValeurChamp <string>("perNom"); lblPrenomCouple.Text = personneCouple.GetValeurChamp <string>("perPrenom"); }
private void AjouterPersonnesARejoindre(LigneTable persARej) { dgvPersonnesARejoindre.Rows.Add(persARej.GetValeurChamp <int>("arjId"), persARej.GetValeurChamp <string>("arjPrenom"), persARej.GetValeurChamp <string>("arjNom"), persARej.GetValeurChamp <string>("arjLien"), persARej.GetValeurChamp <string>("arjTelephone")); }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is LigneTable) { PersonneCourante = (LigneTable)messages[0]; ChargerPersonnesARejoindre(); } }
public frmSelectionTable(string titreFenetre, Table donnees, List <string> champsAffiches, string champCle) : base(false, true) { InitializeComponent(); Text = titreFenetre; gtChoix.Initialiser(donnees, champsAffiches); LigneChoisie = null; }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is LigneTable) { PersonneCourante = (LigneTable)messages[0]; RafraichirPersonneCourante(); } }
public override void EnvoyerMessages(params object[] messages) { if (messages.Length == 1 && messages[0] is LigneTable) { BeneficiaireCourant = (LigneTable)messages[0]; RafraichirEvaluations(); } }
public frmDisponibiliteServicesBenevoles() : base(true, true) { InitializeComponent(); BenevoleCourant = null; cmbService.MouseWheel += new MouseEventHandler(cmbService_MouseWheel); }
public frmGestionDossiers() : base(true, true) { InitializeComponent(); PersonneCourante = null; Statuts = Global.BaseDonneesCABS.EnvoyerRequeteSelection(new RequeteSelection(NomTable.statut)); }
public void Generer(LigneTable donnees) { WordSDK.Application appWord = null; WordSDK.Document doc = null; try { appWord = new WordSDK.Application(); appWord.DisplayAlerts = WordSDK.WdAlertLevel.wdAlertsNone; doc = appWord.Documents.Add(Directory.GetCurrentDirectory() + "\\" + NomFichier, Visible: false); doc.Activate(); foreach (WordSDK.FormField field in doc.FormFields) { Champ champ = donnees.GetChamp(field.Name); if (champ != null) { switch (champ.Type) { case TypeChamp.BOOLEEN: field.CheckBox.Value = (bool)champ.ValeurWord; break; default: field.Range.Text = champ.ValeurWord.ToString(); break; } } } appWord.DisplayAlerts = WordSDK.WdAlertLevel.wdAlertsAll; appWord.Visible = true; } catch (Exception ex) { Journal.AfficherException("Une erreur est survenue lors de la génération du fichier Word. L'action a été annulée.", ex); if (appWord != null && doc != null) { doc.Close(false); appWord.Quit(); } } finally { if (doc != null) { Marshal.ReleaseComObject(doc); } if (appWord != null) { Marshal.ReleaseComObject(appWord); } } }
private void frmSelectionTable_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult != System.Windows.Forms.DialogResult.OK) { return; } LigneChoisie = gtChoix.GetLigneSelectionnee(); }
public frmInscriptionServicesBeneficiaires() : base(true, true) { InitializeComponent(); BeneficiaireCourant = null; FormulaireCourant = null; cmbService.MouseWheel += new MouseEventHandler(cmbService_MouseWheel); }
public override bool Enregistrer() { if (!base.Enregistrer()) { return(false); } LigneTable inscriptionDepannageAlimentaire = new LigneTable("InscriptionDepannageAlimentaire"); inscriptionDepannageAlimentaire.AjouterChamp("idaNombreEnfants", nudNbEnfants.Value); inscriptionDepannageAlimentaire.AjouterChamp("idaAgesEnfants", txtAges.Text); inscriptionDepannageAlimentaire.AjouterChamp("idaDetailsFactures", txtDetailsFactures.Text); inscriptionDepannageAlimentaire.AjouterChamp("idaDetailsAutres", txtDetailsAutres.Text); inscriptionDepannageAlimentaire.AjouterChamp("idaAllocationFamiliale", cbAllocationFamiliale.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaCarteMedicament", cbCarteMedicament.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaCarteAssuranceMaladie", cbCarteAssuranceMaladie.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaPermisConduire", cbPermisConduire.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaProprietaire", cbProprietaire.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaLocataire", cbLocataire.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaBail", cbBail.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaFactures", cbFactures.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaPerteEmploi", cbPerteEmploi.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaSeparation", cbSeparation.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaAccidentAutoMaladie", cbAccidentMaladie.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaFaibleRevenu", cbFaibleRevenu.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaAccidentTravail", cbAccidentTravail.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaDemenagement", cbDemenagement.Checked); inscriptionDepannageAlimentaire.AjouterChamp("idaAutres", cbAutres.Checked); if (Mode == ModeFormulaire.AJOUT) { inscriptionDepannageAlimentaire.AjouterChamp("perId", IndexBeneficiaireCourant); RequeteAjout reqAjout = new RequeteAjout(NomTable.inscriptiondepannagealimentaire, inscriptionDepannageAlimentaire); if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0) { Journal.AfficherMessage("Une erreur est survenue lors de l'inscription au dépannage alimentaire. L'action a été annulée.", TypeMessage.ERREUR, true); return(false); } } else if (Mode == ModeFormulaire.EDITION) { RequeteModification reqModif = new RequeteModification(NomTable.inscriptiondepannagealimentaire, new ConditionRequete(Operateur.EGAL, "perId", IndexBeneficiaireCourant.ToString()), inscriptionDepannageAlimentaire); if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) < 0) { Journal.AfficherMessage("Une erreur est survenue lors de la modification de l'inscription au dépannage alimentaire. L'action a été annulée.", TypeMessage.ERREUR, true); return(false); } } return(true); }
public frmPersonnesARejoindre() : base(true, true) { InitializeComponent(); LigneAjoutee = LigneModifiee = false; PersonneCourante = null; PersonnesARejoindreASupprimer = new List <LigneTable>(); }
private string GetNomAdresseBeneficiaire(LigneTable beneficiaire) { string nom = beneficiaire.GetValeurChamp <string>("perNom"); string prenom = beneficiaire.GetValeurChamp <string>("perPrenom"); int noCivique = beneficiaire.GetValeurChamp <int>("perNoCivique"); string rue = beneficiaire.GetValeurChamp <string>("perRue"); string ville = beneficiaire.GetValeurChamp <string>("perVille"); string codePostal = beneficiaire.GetValeurChamp <string>("perCodePostal"); return(String.Format(FormatNomAdresseBeneficiaire, nom, prenom, noCivique, rue, ville, codePostal)); }
private void ChargerBeneficiaire(LigneTable ligneTable) { if (ligneTable == null) { return; } BeneficiaireCourant = ligneTable; lblPrenomValeur.Text = ligneTable.GetValeurChamp <string>("perPrenom"); lblNomValeur.Text = ligneTable.GetValeurChamp <string>("perNom"); RafraichirService(); }
private void RafraichirService() { ConditionRequete condReqSel = new ConditionRequete(Operateur.EGAL, "perId", BeneficiaireCourant.GetChamp("perId").ValeurSQL); condReqSel.LierCondition(new ConditionRequete(Operateur.EGAL, "serId", (cmbService.SelectedItem as ComboBoxItem).Value.ToString()), true); RequeteSelection reqSel = new RequeteSelection(NomTable.inscriptionservice); reqSel.Condition = condReqSel; Table inscription = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel); string nomFormulaire = Global.GetNomFormulaireInscription(cmbService.Text); panFormulaireInscription.Controls.Clear(); Type typeFormulaire = Type.GetType(nomFormulaire); try { FormulaireCourant = (Formulaire)Activator.CreateInstance(typeFormulaire); } catch (Exception) { FormulaireCourant = null; return; } if (!inscription.EstVide) { ChangerAccesControle(ModeFormulaire.CONSULTATION); LigneTable infosInscription = inscription.Lignes[0]; dtpDateDemande.Value = infosInscription.GetValeurChamp <DateTime>("insDateDemande"); cbSuspendu.Checked = infosInscription.GetValeurChamp <bool>("insSuspendu"); txtCommentaires.Text = infosInscription.GetValeurChamp <string>("insCommentaires"); } else { ChangerAccesControle(ModeFormulaire.AJOUT); Vider(); FormulaireCourant.Vider(); } FormulaireCourant.Name = nomFormulaire; FormulaireCourant.Dock = DockStyle.Fill; FormulaireCourant.TopLevel = false; FormulaireCourant.AutoScroll = true; FormulaireCourant.EnvoyerMessages(BeneficiaireCourant.GetValeurChamp <int>("perId")); panFormulaireInscription.Controls.Add(FormulaireCourant); FormulaireCourant.Show(); }