private void Btn_Recherche_Click(object sender, RoutedEventArgs e)
        {
            this.Txt_NouvIndex.Text        = string.Empty;
            this.Txt_AncIndex.Text         = string.Empty;
            this.Cbo_Compteur.SelectedItem = null;
            this.Txt_NomAbon.Text          = string.Empty;

            if (this.Txt_CodeCentre.Tag != null && !string.IsNullOrEmpty(this.Txt_PeriodeEnCour.Text))
            {
                int idcentre = int.Parse(this.Txt_CodeCentre.Tag.ToString());
                ServiceAccueil.CsClient leClient = new ServiceAccueil.CsClient();
                leClient.CENTRE    = Txt_CodeCentre.Text;
                leClient.REFCLIENT = this.txtClient.Text;
                leClient.PRODUIT   = this.Txt_Produit.Tag.ToString();

                leClient.FK_IDCENTRE = idcentre;
                string OrdreMax = string.Empty;
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.RetourneOrdreMaxCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    OrdreMax = args.Result;
                    if (OrdreMax != null)
                    {
                        leClient.ORDRE     = OrdreMax;
                        this.txtOrdre.Text = OrdreMax;
                        //RetourneInfoClient(leClient);
                        VerifieExisteDemande(leClient);
                    }
                    else
                    {
                        Message.ShowInformation("Abonnement non trouvé", "Facturation");
                        return;
                    }
                };
                service.RetourneOrdreMaxAsync(leClient.FK_IDCENTRE.Value, leClient.CENTRE, leClient.REFCLIENT, leClient.PRODUIT);
                service.CloseAsync();
            }
            else
            {
                Message.ShowInformation("Saisir la période à modifier", "Facturation");
                return;
            }
        }
        private void VerifieExisteDemande(ServiceAccueil.CsClient leClient)
        {
            try
            {
                if (!string.IsNullOrEmpty(leClient.REFCLIENT) && leClient.REFCLIENT.Length == SessionObject.Enumere.TailleClient)
                {
                    leClient.PERIODE     = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(this.Txt_PeriodeEnCour.Text);
                    leClient.TYPEDEMANDE = SessionObject.Enumere.ReprisIndex;

                    ServiceAccueil.AcceuilServiceClient service = new ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                    service.RetourneDemandeClientTypeCompleted += (s, args) =>
                    {
                        if (args != null && args.Cancelled)
                        {
                            return;
                        }
                        if (args.Result != null)
                        {
                            if (args.Result.DATEFIN == null && args.Result.ISSUPPRIME != true)
                            {
                                Message.ShowInformation("Il existe une demande numéro " + args.Result.NUMDEM + " sur ce client", "Accueil");
                                return;
                            }
                        }

                        int      idcentre          = int.Parse(this.Txt_CodeCentre.Tag.ToString());
                        CsClient leClientRecherche = new CsClient();
                        leClientRecherche.CENTRE    = Txt_CodeCentre.Text;
                        leClientRecherche.REFCLIENT = this.txtClient.Text;
                        leClientRecherche.PRODUIT   = this.Txt_Produit.Tag.ToString();

                        leClientRecherche.FK_IDCENTRE = idcentre;
                        leClientRecherche.ORDRE       = leClient.ORDRE;


                        RetourneInfoClient(leClientRecherche);
                    };
                    service.RetourneDemandeClientTypeAsync(leClient);
                    service.CloseAsync();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }