void ChargerDiametreCompteur() { try { if (SessionObject.LstDiametreCompteur.Count != 0) { if (TypeDemande == SessionObject.Enumere.ModificationCompteur) { LstDiametre = SessionObject.LstDiametreCompteur; } else { LstDiametre = SessionObject.LstDiametreCompteur.Where(p => p.PRODUIT == LaDemande.LaDemande.PRODUIT).ToList(); } if (LstDiametre.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeDiametre.Text) && string.IsNullOrEmpty(this.Txt_LibelleDiametre.Text)) { CsDiacomp _LeCompteur = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE"); if (_LeCompteur != null && !string.IsNullOrEmpty(_LeCompteur.LIBELLE)) { this.Txt_LibelleDiametre.Text = _LeCompteur.LIBELLE; } } } } else { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.ChargerDiametreCompteurCompleted += (s, args) => { LstDiametre = new List <CsDiacomp>(); if (args != null && args.Cancelled) { return; } LstDiametre = args.Result; if (LstDiametre != null && LstDiametre.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeDiametre.Text) && string.IsNullOrEmpty(this.Txt_LibelleDiametre.Text)) { CsDiacomp _LeCompteur = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE"); if (_LeCompteur != null && !string.IsNullOrEmpty(_LeCompteur.LIBELLE)) { this.Txt_LibelleDiametre.Text = _LeCompteur.LIBELLE; } } } }; service.ChargerDiametreCompteurAsync(); service.CloseAsync(); } } catch (Exception ex) { throw ex; } }
private void Txt_CodeMarque_TextChanged(object sender, TextChangedEventArgs e) { try { if (this.Txt_CodeMarque.Text.Length == SessionObject.Enumere.TailleCodeMarqueCompteur && (LstMarque != null && LstMarque.Count != 0)) { CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_CodeMarque.Text, "CODE"); if (!string.IsNullOrEmpty(_LaMarque.LIBELLE)) { this.Txt_LibelleMarque.Text = _LaMarque.LIBELLE; this.Txt_CodeMarque.Tag = _LaMarque.PK_ID; } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeMarque.Focus(); }; w.Show(); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodeCentre_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeCentre.Text) && Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre) { ServiceAccueil.CsCentre _LeCentreClient = ClasseMEthodeGenerique.RetourneObjectFromList(LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_CodeSite.Tag).ToList(), this.Txt_CodeCentre.Text, "CODE"); if (!string.IsNullOrEmpty(_LeCentreClient.LIBELLE)) { this.Txt_CodeCentre.Text = _LeCentreClient.CODE; this.Txt_LibelleCentre.Text = _LeCentreClient.LIBELLE; this.Txt_CodeCentre.Tag = _LeCentreClient.PK_ID; lProduitSelect = _LeCentreClient.LESPRODUITSDUSITE; if (lProduitSelect != null && lProduitSelect.Count != 0) { this.Txt_Produit.Text = lProduitSelect.First().LIBELLE; this.Txt_Produit.Tag = lProduitSelect.First().CODE; this.btn_Produit.Tag = lProduitSelect.First().PK_ID; //this.txtClient.IsReadOnly = false; } } } } catch (Exception ex) { Message.ShowError(ex.Message, this.Title.ToString()); } }
void RemplirLibelle() { if (this.Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre) { CsCentre _LeCentre = ClasseMEthodeGenerique.RetourneObjectFromList <CsCentre>(SessionObject.LstCentre, this.Txt_CodeCentre.Text, "CODE"); if (_LeCentre != null && !string.IsNullOrEmpty(_LeCentre.CODE)) { this.Txt_LibelleCentre.Text = _LeCentre.LIBELLE; this.Txt_CodeSite.Text = _LeCentre.CODESITE; this.Txt_LibelleSite.Text = _LeCentre.LIBELLESITE; } } //if (this.Txt_CodeDiametre.Text.Length == SessionObject.Enumere.TailleDiametreBranchement && SessionObject.LstDiametreBrt.Count != 0) //{ // CsTypeBranchement leDbrt = SessionObject.LstDiametreBrt.FirstOrDefault(t => t.CODE == Txt_CodeDiametre.Text); // if (leDbrt != null) // this.Txt_LibelleDiametre.Text = leDbrt.LIBELLE; //} //if (this.Txt_CodeMateriel.Text.Length == 1 && SessionObject.LstDiametreBrt.Count != 0) //{ // CsMaterielBranchement leMaterielBrt = SessionObject.LstDeMaterielBrt.FirstOrDefault(t => t.CODE == this.Txt_CodeMateriel.Text); // if (leMaterielBrt != null) // this.Txt_LibelleMateriel.Text = leMaterielBrt.LIBELLE; //} if (this.Txt_CodeProduit.Text.Length == SessionObject.Enumere.TailleCodeProduit) { LaDemande.LaDemande.PRODUIT = this.Txt_CodeProduit.Text; CsProduit _LeProduitSelect = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.ListeDesProduit, this.Txt_CodeProduit.Text, "CODE"); if (!string.IsNullOrEmpty(_LeProduitSelect.LIBELLE)) { this.Txt_LibelleProduit.Text = _LeProduitSelect.LIBELLE; } } }
void ChargerMarque() { try { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.RetourneToutMarqueCompleted += (s, args) => { LstMarque = new List <CsMarqueCompteur>(); if (args != null && args.Cancelled) { return; } LstMarque = args.Result; if (LstMarque != null && LstMarque.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_MarqueCompteur.Text) && (!string.IsNullOrEmpty(this.Txt_LibelleMarque.Text))) { CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_MarqueCompteur.Text, "PK_MARQUECOMPTEUR"); if (string.IsNullOrEmpty(_LaMarque.LIBELLE)) { this.Txt_MarqueCompteur.Text = _LaMarque.LIBELLE; } } } }; service.RetourneToutMarqueAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void Txt_CodeTarif_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) && LstTarif != null && LstTarif.Count != 0 && this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif) { CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(LstTarif, this.Txt_CodeTarif.Text, "CODE"); if (_LeTarif != null) { this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE; this.Txt_CodeTarif.Tag = _LeTarif.PK_ID; EnregistrerDemande(LaDemande); this.btn_PussSouscrite.IsEnabled = true; LstPuissanceTarif = SessionObject.LstTarifPuissance.Where(t => t.PK_ID == _LeTarif.PK_ID).ToList(); //LstPuissanceTarif.ForEach(t => t.CODEPUISSANCE = (decimal.Parse(t.CODEPUISSANCE)).ToString()); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeTarif.Focus(); }; w.Show(); } } }
private void Txt_CodeMoisIndex_TextChanged(object sender, TextChangedEventArgs e) { try { if (LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisIndex.Text, "CODE"); if (_LeMois != null) { this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE; this.Txt_CodeMoisIndex.Tag = _LeMois.PK_ID; EnregistrerDemande(LaDemande); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeMoisFacturation.Focus(); }; w.Show(); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodePoste_TextChanged(object sender, TextChangedEventArgs e) { if (this.Txt_CodePoste.Text.Length == SessionObject.Enumere.TailleCodeQuartier && (LstDePosteElectrique != null && LstDePosteElectrique.Count != 0)) { CsPosteElectrique _lePoste = ClasseMEthodeGenerique.RetourneObjectFromList <CsPosteElectrique>(LstDePosteElectrique, this.Txt_CodePoste.Text, "CODE"); if (_lePoste != null && !string.IsNullOrEmpty(_lePoste.LIBELLE)) { this.Txt_LibellePoste.Text = _lePoste.LIBELLE; LePosteBrtSelect = _lePoste; if (TypeDemande != SessionObject.Enumere.ModificationBranchement) { EnregisterDemande(LaDemande); } } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodePoste.Focus(); this.Txt_CodePoste.Text = string.Empty; this.Txt_LibellePoste.Text = string.Empty; }; w.Show(); } } }
private void Txt_CadranCompteur_TextChanged(object sender, TextChangedEventArgs e) { try { if (this.Txt_CadranCompteur.Text.Length == SessionObject.Enumere.TailleDigitCompteur && LstCadran != null && LstCadran.Count != 0) { CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CadranCompteur.Text, "CODE"); if (!string.IsNullOrEmpty(_LeCadran.LIBELLE)) { this.Txt_LibelleCadran.Text = _LeCadran.LIBELLE; //EnregistrerInfoSaisie(LaDemande); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CadranCompteur.Focus(); }; w.Show(); } } } catch (Exception ex) { throw ex; } }
private void Txt_CodeProduit_TextChanged(object sender, TextChangedEventArgs e) { try { if (this.Txt_CodeProduit.Text.Length == SessionObject.Enumere.TailleCodeProduit) { LaDemande.LaDemande.PRODUIT = this.Txt_CodeProduit.Text; CsProduit _LeProduitSelect = ClasseMEthodeGenerique.RetourneObjectFromList(ListeDesProduitDuSite, this.Txt_CodeProduit.Text, "CODE"); if (!string.IsNullOrEmpty(_LeProduitSelect.LIBELLE)) { this.Txt_LibelleProduit.Text = _LeProduitSelect.LIBELLE; LaDemande.LaDemande.FK_IDPRODUIT = _LeProduitSelect.PK_ID; } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeProduit.Focus(); }; w.Show(); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodeMateriel_TextChanged(object sender, TextChangedEventArgs e) { try { if (this.Txt_CodeMateriel.Text.Length == SessionObject.Enumere.TailleCodeMateriel && (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0)) { CsMaterielBranchement _leMateriel = ClasseMEthodeGenerique.RetourneObjectFromList <CsMaterielBranchement>(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE"); if (_leMateriel != null && !string.IsNullOrEmpty(_leMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _leMateriel.LIBELLE; LeDeMaterielBrtSelect = _leMateriel; if (TypeDemande != SessionObject.Enumere.ModificationBranchement) { EnregisterDemande(LaDemande); } } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeMateriel.Focus(); this.Txt_CodeMateriel.Text = string.Empty; this.Txt_LibelleMateriel.Text = string.Empty; }; w.Show(); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodeCentre_TextChanged(object sender, TextChangedEventArgs e) { if (this.Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre && LstCentre != null && LstCentre.Count != 0) { CsCentre _LeCentre = ClasseMEthodeGenerique.RetourneObjectFromList <CsCentre>(LstCentre, this.Txt_CodeCentre.Text, "CODE"); if (_LeCentre != null) { this.Txt_LibelleCentre.Text = _LeCentre.LIBELLE; this.Txt_NumDemande.Text = _LeCentre.CODE + _LeCentre.NUMDEM.ToString().PadLeft(10, '0'); LaDemande.LaDemande.CENTRE = _LeCentre.CODE;; LaDemande.LaDemande.FK_IDCENTRE = _LeCentre.PK_ID; LaDemande.LaDemande.NUMDEM = this.Txt_NumDemande.Text; LaDemande.LaDemande.MATRICULE = UserConnecte.matricule; } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeCentre.Focus(); }; w.Show(); } } }
private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeSite.Text) && Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre) { Galatee.Silverlight.ServiceAccueil.CsSite _LeSiteClient = ClasseMEthodeGenerique.RetourneObjectFromList(lstSite, this.Txt_CodeSite.Text, "CODE"); if (!string.IsNullOrEmpty(_LeSiteClient.LIBELLE)) { this.Txt_LibelleSite.Text = _LeSiteClient.LIBELLE; this.Txt_CodeSite.Text = _LeSiteClient.CODE; this.Txt_CodeSite.Tag = _LeSiteClient.PK_ID; List <int> lstCentreSelect = new List <int>(); List <ServiceAccueil.CsCentre> lsiteCentre = LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_CodeSite.Tag).ToList(); if (lsiteCentre.Count == 1) { lstCentreSelect.Add(lsiteCentre.First().PK_ID); this.Txt_CodeCentre.Text = lsiteCentre.First().CODE; this.Txt_LibelleCentre.Text = lsiteCentre.First().LIBELLE; this.Txt_CodeCentre.Tag = lstCentreSelect; } } } } catch (Exception ex) { Message.ShowError(ex.Message, "Facturation"); } }
private void Txt_CodeCommune_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(this.Txt_CodeCommune.Text) && this.Txt_CodeCommune.Text.Length == SessionObject.Enumere.TailleCodeQuartier && LstCommuneAll.Where(t => t.FK_IDCENTRE == (int)laDetailDemande.Ag.FK_IDCENTRE).ToList().Count != 0) { CsCommune LaCommuneSelect = ClasseMEthodeGenerique.RetourneObjectFromList(LstCommuneAll.Where(t => t.FK_IDCENTRE == (int)laDetailDemande.Ag.FK_IDCENTRE).ToList(), this.Txt_CodeCommune.Text, "CODE"); if (!string.IsNullOrEmpty(LaCommuneSelect.LIBELLE)) { this.Txt_LibelleCommune.Text = LaCommuneSelect.LIBELLE; this.Txt_CodeCommune.Tag = LaCommuneSelect.PK_ID; } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.Msg_CommuneNonTrouve, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_LibelleCommune.Text = string.Empty; this.Txt_CodeCommune.Text = string.Empty; this.Txt_CodeCommune.Focus(); }; w.Show(); } } }
private void Txt_CodeDiametre_TextChanged(object sender, TextChangedEventArgs e) { try { if (this.Txt_CodeDiametre.Text.Length == SessionObject.Enumere.TailleDiametre && (LstDiametre != null && LstDiametre.Count != 0)) { CsDiacomp _LeDiametre = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE"); if (!string.IsNullOrEmpty(_LeDiametre.LIBELLE)) { LeDiametreSelect = _LeDiametre; this.Txt_LibelleDiametre.Text = _LeDiametre.LIBELLE; EnregistrerInfoSaisie(LaDemande); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeDiametre.Focus(); }; w.Show(); Txt_CodeDiametre.Text = string.Empty; Txt_LibelleDiametre.Text = string.Empty; } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
void ChargerMAterielBranchement(string Produit) { try { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.RetourneMaterielBranchementCompleted += (s, args) => { LstDeMaterielBrt = new List <CsMaterielBranchement>(); if ((args != null && args.Cancelled) || (args.Error != null)) { return; } LstDeMaterielBrt.AddRange(args.Result); if (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeMateriel.Text)) { CsMaterielBranchement _LeMateriel = ClasseMEthodeGenerique.RetourneObjectFromList(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "MATERIEL"); if (_LeMateriel != null && !string.IsNullOrEmpty(_LeMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _LeMateriel.LIBELLE; } } } }; service.RetourneMaterielBranchementAsync(Produit); service.CloseAsync(); } catch (Exception es) { MessageBox.Show(es.Message); } }
private void ChargerPosteElectrique() { try { if (SessionObject.LsDesPosteElectriques.Count != 0) { LstDePosteElectrique = SessionObject.LsDesPosteElectriques; if (LstDePosteElectrique != null && LstDePosteElectrique.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_LibelleDepart.Text)) { CsPosteElectrique _LePosteElect = LstDePosteElectrique.FirstOrDefault(p => p.CODE == LaDemande.Branchement.CODEPOSTE); if (_LePosteElect != null && !string.IsNullOrEmpty(_LePosteElect.LIBELLE)) { this.Txt_SequenceNumPoste.Text = _LePosteElect.LIBELLE; } } } } else { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.ChargerLesPosteElectriqueCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LsDesPosteElectriques = args.Result; LstDePosteElectrique = SessionObject.LsDesPosteElectriques; this.Txt_CodePoste.Text = string.IsNullOrEmpty(_LeBranchement.CODEPOSTE) ? string.Empty : _LeBranchement.CODEPOSTE; if (LstDePosteElectrique != null && LstDePosteElectrique.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodePoste.Text)) { CsPosteElectrique _LePoste = ClasseMEthodeGenerique.RetourneObjectFromList(LstDePosteElectrique, this.Txt_CodePoste.Text, "CODE"); if (_LePoste != null && !string.IsNullOrEmpty(_LePoste.LIBELLE)) { this.Txt_LibellePoste.Text = _LePoste.LIBELLE; } } } }; service.ChargerLesPosteElectriqueAsync(); service.CloseAsync(); } } catch (Exception es) { MessageBox.Show(es.Message); } }
private void ChargerMaterielBranchement() { try { if (SessionObject.LstDeMaterielBrt.Count != 0) { LstDeMaterielBrt = SessionObject.LstDeMaterielBrt.Where(p => p.PRODUIT == LaDemande.LaDemande.PRODUIT).ToList(); this.Txt_CodeMateriel.Text = string.IsNullOrEmpty(_LeBranchement.NATBRT) ? string.Empty : _LeBranchement.NATBRT; if (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeMateriel.Text)) { CsMaterielBranchement _LeMateriel = ClasseMEthodeGenerique.RetourneObjectFromList(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE"); if (_LeMateriel != null && !string.IsNullOrEmpty(_LeMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _LeMateriel.LIBELLE; } } } } else { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.RetourneMaterielBranchementCompleted += (s, args) => { if ((args != null && args.Cancelled) || (args.Error != null)) { return; } SessionObject.LstDeMaterielBrt = args.Result; LstDeMaterielBrt = SessionObject.LstDeMaterielBrt.Where(p => p.PRODUIT == LaDemande.LaDemande.PRODUIT).ToList(); this.Txt_CodeMateriel.Text = string.IsNullOrEmpty(_LeBranchement.NATBRT) ? string.Empty : _LeBranchement.NATBRT; if (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeMateriel.Text)) { CsMaterielBranchement _LeMateriel = ClasseMEthodeGenerique.RetourneObjectFromList(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE"); if (_LeMateriel != null && !string.IsNullOrEmpty(_LeMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _LeMateriel.LIBELLE; } } } }; service.RetourneMaterielBranchementAsync(); service.CloseAsync(); } } catch (Exception es) { throw es; } }
void ChargerCadran() { try { if (SessionObject.LstCadran.Count != 0) { LstCadran = SessionObject.LstCadran; if (LstCadran != null && LstCadran.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeCadran.Text) && (string.IsNullOrEmpty(this.Txt_LibelleDigit.Text))) { CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CodeCadran.Text, "CODECADRAN"); if (_LeCadran != null && !string.IsNullOrEmpty(_LeCadran.LIBELLE)) { this.Txt_LibelleDigit.Text = _LeCadran.LIBELLE; } } } } else { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.RetourneToutCadranCompleted += (s, args) => { LstCadran = new List <CsCadran>(); if (args != null && args.Cancelled) { return; } LstCadran = args.Result; if (LstCadran != null && LstCadran.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeCadran.Text) && (string.IsNullOrEmpty(this.Txt_LibelleDigit.Text))) { CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CodeCadran.Text, "CODECADRAN"); if (_LeCadran != null && !string.IsNullOrEmpty(_LeCadran.LIBELLE)) { this.Txt_LibelleDigit.Text = _LeCadran.LIBELLE; } } } }; service.RetourneToutCadranAsync(); service.CloseAsync(); } } catch (Exception ex) { throw ex; } }
private void RemplireLibelle() { try { if (SessionObject.LstFrequence.Count != 0 && this.Txt_CodeFrequence.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsFrequence _LaFrequence = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstFrequence, this.Txt_CodeFrequence.Text, "CODE"); if (_LaFrequence != null) { this.Txt_LibelleFrequence.Text = _LaFrequence.LIBELLE; } } if (SessionObject.LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstMois, this.Txt_CodeMoisIndex.Text, "CODE"); if (_LeMois != null) { this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE; } } if (SessionObject.LstMois.Count != 0 && this.Txt_CodeMoisFacturation.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstMois, this.Txt_CodeMoisFacturation.Text, "CODE"); if (_LeMois != null) { this.Txt_LibMoisFact.Text = _LeMois.LIBELLE; } } if (SessionObject.LstForfait.Count != 0 && this.Txt_CodeForfait.Text.Length == SessionObject.Enumere.TailleForfait) { CsForfait _LeForfait = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstForfait, this.Txt_CodeForfait.Text, "CODE"); if (_LeForfait != null) { this.Txt_LibelleForfait.Text = _LeForfait.LIBELLE; } } if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) && SessionObject.LstTarif != null && SessionObject.LstTarif.Count != 0 && this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif) { CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstTarif, this.Txt_CodeTarif.Text, "CODE"); if (_LeTarif != null) { this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE; } } } catch (Exception ex) { throw ex; } }
private void ChargerPosteElectrique() { try { //if (SessionObject.LsDesPosteElectriques .Count != 0) //{ // LstDePosteElectrique = SessionObject.LsDesPosteElectriques; // if (LstDePosteElectrique != null && LstDePosteElectrique.Count != 0) // { // if (!string.IsNullOrEmpty(this.Txt_LibelleDepart .Text)) // { // CsPosteElectrique _LePosteElect = LstDePosteElectrique.FirstOrDefault(p => p.CODE == LaDemande.Branchement.CODEPOSTE); // if (_LePosteElect != null && !string.IsNullOrEmpty(_LePosteElect.LIBELLE)) // this.Txt_SequenceNumPoste.Text = _LePosteElect.LIBELLE; // } // } //} //else //{ AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.RetourneMaterielBranchementCompleted += (s, args) => { if ((args != null && args.Cancelled) || (args.Error != null)) { return; } SessionObject.LstDeMaterielBrt = args.Result; LstDeMaterielBrt = SessionObject.LstDeMaterielBrt.Where(p => p.PRODUIT == LaDemande.LaDemande.PRODUIT).ToList(); this.Txt_CodeMateriel.Text = string.IsNullOrEmpty(_LeBranchement.NATBRT) ? string.Empty : _LeBranchement.NATBRT; if (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0) { if (!string.IsNullOrEmpty(this.Txt_CodeMateriel.Text)) { CsMaterielBranchement _LeMateriel = ClasseMEthodeGenerique.RetourneObjectFromList(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE"); if (_LeMateriel != null && !string.IsNullOrEmpty(_LeMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _LeMateriel.LIBELLE; } } } }; service.RetourneMaterielBranchementAsync(); service.CloseAsync(); //} } catch (Exception es) { MessageBox.Show(es.Message); } }
void AfficherCannalisationDemande(CsCanalisation LaCanalisation, CsEvenement LeEvt) { CsEvenement _LeEvt = new CsEvenement(); if ((LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.ChangementCompteur && NumCompteur == 1) || LaDemande.LeTypeDemande.CODE != SessionObject.Enumere.ChangementCompteur) { this.Txt_NumCompteur.Text = (string.IsNullOrEmpty(LaCanalisation.NUMERO)) ? string.Empty : LaCanalisation.NUMERO; this.Txt_AnneeFab.Text = (string.IsNullOrEmpty(LaCanalisation.ANNEEFAB)) ? string.Empty : LaCanalisation.ANNEEFAB; this.Txt_CodeTypeCompteur.Text = (string.IsNullOrEmpty(LaCanalisation.TYPECOMPTEUR)) ? string.Empty : LaCanalisation.TYPECOMPTEUR; CsTcompteur _LeTypeCompte = ClasseMEthodeGenerique.RetourneObjectFromList(LstTypeCompteur, this.Txt_CodeTypeCompteur.Text, "CODE"); if (!string.IsNullOrEmpty(_LeTypeCompte.LIBELLE)) { LeTypeCompteurSelect = _LeTypeCompte; this.Txt_LibelleTypeCompteur.Text = _LeTypeCompte.LIBELLE; } this.Txt_CodeMarque.Text = (string.IsNullOrEmpty(LaCanalisation.MARQUE)) ? string.Empty : LaCanalisation.MARQUE; CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_CodeMarque.Text, "CODE"); if (!string.IsNullOrEmpty(_LaMarque.LIBELLE)) { this.Txt_LibelleMarque.Text = _LaMarque.LIBELLE; } this.Txt_CodeCadran.Text = LaCanalisation.CADRAN.Value.ToString(); CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CodeCadran.Text, "CODECADRAN"); if (!string.IsNullOrEmpty(_LeCadran.LIBELLE)) { this.Txt_LibelleDigit.Text = _LeCadran.LIBELLE; LeCadranSelect = _LeCadran; } this.Txt_CodeDiametre.Text = (string.IsNullOrEmpty(LaCanalisation.DIAMETRE)) ? string.Empty : LaCanalisation.DIAMETRE; CsDiacomp _LeDiametre = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE"); if (!string.IsNullOrEmpty(_LeDiametre.LIBELLE)) { LeDiametreSelect = _LeDiametre; this.Txt_LibelleDiametre.Text = _LeDiametre.LIBELLE; } if (LaCanalisation.COEFLECT != 0) { this.Chk_CoefMultiplication.IsChecked = true; } } }
private void Txt_CodeProduit_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeProduit.Text) && this.Txt_CodeProduit.Text.Length == SessionObject.Enumere.TailleCodeProduit) { CsProduit _LeProduit = ClasseMEthodeGenerique.RetourneObjectFromList(LstDeProduit, this.Txt_CodeProduit.Text, "CODE"); if (!string.IsNullOrEmpty(_LeProduit.CODE)) { this.Txt_LibelleProduitRech.Text = _LeProduit.LIBELLE; } } } catch (Exception ex) { Message.ShowError(ex.Message, "Menu"); } }
private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeSite.Text) && Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre) { CsSite _LeSiteClient = ClasseMEthodeGenerique.RetourneObjectFromList(lstSite, this.Txt_CodeSite.Text, "CODE"); if (!string.IsNullOrEmpty(_LeSiteClient.LIBELLE)) { this.Txt_LibelleSite.Text = _LeSiteClient.LIBELLE; LstCentre = SessionObject.LstCentre.Where(t => t.FK_IDCODESITE == _LeSiteClient.PK_ID).ToList(); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
void AfficherBranchemetDemande(CsBrt _LeBrtDemande) { //if (_Lademande.ISSUBVENTION == SessionObject.Enumere.IsBranchementSubventione) // chk_EstSubventionne.IsChecked = true; //else // chk_EstSubventionne.IsChecked = false; this.Txt_CodeDiametre.Text = string.IsNullOrEmpty(_LeBrtDemande.DIAMBRT) ? string.Empty : _LeBrtDemande.DIAMBRT; CsTypeBranchement _leDiametre = ClasseMEthodeGenerique.RetourneObjectFromList <CsTypeBranchement>(LstDiametreBrt, this.Txt_CodeDiametre.Text, "CODE"); if (_leDiametre != null && !string.IsNullOrEmpty(_leDiametre.LIBELLE)) { this.Txt_LibelleDiametre.Text = _leDiametre.LIBELLE; //EnregisterDemande(LaDemande); } this.Txt_CodeMateriel.Text = string.IsNullOrEmpty(_LeBrtDemande.NATBRT) ? string.Empty : _LeBrtDemande.NATBRT; CsMaterielBranchement _leMateriel = ClasseMEthodeGenerique.RetourneObjectFromList <CsMaterielBranchement>(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE"); if (_leMateriel != null && !string.IsNullOrEmpty(_leMateriel.LIBELLE)) { this.Txt_LibelleMateriel.Text = _leMateriel.LIBELLE; //EnregisterDemande(LaDemande); } this.Txt_LongueurBrt.Text = string.IsNullOrEmpty(_LeBrtDemande.LONGBRT.ToString()) ? InitValue.ToString() : _LeBrtDemande.LONGBRT.ToString(); this.Txt_NombrePoint.Text = _LeBrtDemande.NBPOINT.ToString(); this.Txt_DateRacordement.Text = string.IsNullOrEmpty(_LeBrtDemande.DRAC.ToString()) ? string.Empty :Convert.ToDateTime(_LeBrtDemande.DRAC).ToShortDateString(); this.Txt_DateDepose.Text = string.IsNullOrEmpty(_LeBrtDemande.DRES.ToString()) ? string.Empty : Convert.ToDateTime(_LeBrtDemande.DRES).ToShortDateString(); this.Txt_Longitude.Text = string.IsNullOrEmpty(_LeBrtDemande.LONGITUDE) ? string.Empty : _LeBrtDemande.LONGITUDE; this.Txt_Latitude.Text = string.IsNullOrEmpty(_LeBrtDemande.LATITUDE) ? string.Empty : _LeBrtDemande.LATITUDE; this.Txt_AdresseElectrique.Text = string.IsNullOrEmpty(_LeBrtDemande.ADRESSERESEAU) ? string.Empty : _LeBrtDemande.ADRESSERESEAU; if (TypeDemande == SessionObject.Enumere.FermetureBrt || //TypeDemande == SessionObject.Enumere.Reabonnement || TypeDemande == SessionObject.Enumere.ModificationBranchement || TypeDemande == SessionObject.Enumere.ReouvertureBrt) { IsControleActif(false); } }
private void Txt_CodeRechercheTarif_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeRechercheTarif.Text) && Txt_CodeRechercheTarif.Text.Length == 3) { CsRechercheTarif _LaRechercheTarif = ClasseMEthodeGenerique.RetourneObjectFromList(ListeRechercheTarif, this.Txt_CodeRechercheTarif.Text, "CODE"); if (!string.IsNullOrEmpty(_LaRechercheTarif.LIBELLE)) { this.Txt_LibelleRechercheTarif.Text = _LaRechercheTarif.LIBELLE; IdRechercheTarif = _LaRechercheTarif.PK_ID; } } } catch (Exception ex) { Message.ShowError(ex.Message, "Menu"); } }
private void Txt_CodeRedevence_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeRedevence.Text) && Txt_CodeRedevence.Text.Length == 2) { CsRedevance _LaRedevance = ClasseMEthodeGenerique.RetourneObjectFromList(ListeRedevence, this.Txt_CodeRedevence.Text, "CODE"); if (!string.IsNullOrEmpty(_LaRedevance.LIBELLE)) { this.Txt_LibelleRedevence.Text = _LaRedevance.LIBELLE; IdRedevance = _LaRedevance.PK_ID; this.csVariableDeTarification.FK_IDREDEVANCE = IdRedevance; } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e) { if (this.Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre) { CsSite _LeSite = ClasseMEthodeGenerique.RetourneObjectFromList <CsSite>(lstSite, this.Txt_CodeSite.Text, "CODESITE"); if (_LeSite != null && !string.IsNullOrEmpty(_LeSite.CODESITE)) { this.Txt_LibelleSite.Text = _LeSite.LIBELLE; } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeCentre.Focus(); }; w.Show(); } } }
private void Txt_CodeModeApp_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeModeApp.Text) && Txt_CodeModeApp.Text.Length == 1) { CsModeApplicationTarif _LeModeApp = ClasseMEthodeGenerique.RetourneObjectFromList(ListeModeApplicationTarif, this.Txt_CodeModeApp.Text, "CODE"); if (!string.IsNullOrEmpty(_LeModeApp.LIBELLE)) { this.Txt_LibelleModeApp.Text = _LeModeApp.LIBELLE; IdModeApp = _LeModeApp.PK_ID; this.csVariableDeTarification.FK_IDMODEAPPLICATION = IdModeApp; } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void Txt_CodeCentre_TextChanged(object sender, TextChangedEventArgs e) { try { if (!string.IsNullOrEmpty(Txt_CodeCentre.Text) && Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre) { ServiceAccueil.CsCentre _LeCentreClient = ClasseMEthodeGenerique.RetourneObjectFromList(LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_CodeSite.Tag).ToList(), this.Txt_CodeCentre.Text, "CODE"); if (!string.IsNullOrEmpty(_LeCentreClient.LIBELLE)) { this.Txt_CodeCentre.Text = _LeCentreClient.CODE; this.Txt_LibelleCentre.Text = _LeCentreClient.LIBELLE; this.Txt_CodeCentre.Tag = _LeCentreClient.PK_ID; } } } catch (Exception ex) { Message.ShowError(ex.Message, this.Title.ToString()); } }