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); } }
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); } }
void galatee_OkClickedBtnerMateriel(object sender, EventArgs e) { UcListeGenerique ctrs = sender as UcListeGenerique; CsMaterielBranchement _LeMateriel = (CsMaterielBranchement)ctrs.MyObject; this.Txt_CodeMateriel.Text = _LeMateriel.CODE; this.btn_materiel.IsEnabled = true; }
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; } }
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 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); } }