Ejemplo n.º 1
0
 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();
         }
     }
 }
Ejemplo n.º 2
0
        private void galatee_OkClickedBtnPoste(object sender, EventArgs e)
        {
            this.btn_Poste.IsEnabled = true;
            UcListeGenerique ctrs = sender as UcListeGenerique;

            if (ctrs.isOkClick)
            {
                CsPosteElectrique _LstPoste = (CsPosteElectrique)ctrs.MyObject;
                this.Txt_CodePoste.Text = _LstPoste.CODE;
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }