private void ChargerPiaAgence(string CodeSite)
        {
            try
            {
                Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                service.RetournePIAAgenceCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    List <CsUtilisateur> lstPia = new List <CsUtilisateur>();
                    lstPia.Add(new CsUtilisateur()
                    {
                        LIBELLE = "Aucun"
                    });
                    lstPia.AddRange(args.Result);

                    this.cmbAgent.ItemsSource       = null;
                    this.cmbAgent.ItemsSource       = lstPia;
                    this.cmbAgent.DisplayMemberPath = "LIBELLE";
                    return;
                };
                service.RetournePIAAgenceAsync(CodeSite);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ChargerClientFromReference(int idCentre, string ReferenceClient, string Ordre)
        {
            try
            {
                Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                service.RetourneClientByReferenceOrdreCompleted += (s, args) =>
                {
                    if ((args != null && args.Cancelled) || (args.Error != null))
                    {
                        return;
                    }

                    if (args.Result != null)
                    {
                        this.Txt_NomClient.Text      = args.Result.NOMABON;
                        this.Txt_AdresseClient.Text  = !string.IsNullOrEmpty(args.Result.ADRESSE)?args.Result.ADRESSE :string.Empty;
                        this.Txt_ReferenceClient.Tag = args.Result;
                    }
                };
                service.RetourneClientByReferenceOrdreAsync(idCentre, ReferenceClient, Ordre);
                service.CloseAsync();
            }
            catch (Exception)
            {
                Message.ShowError("Erreur au chargement des données", "Demande");
            }
        }
 private void MiseAJourDecharge()
 {
     try
     {
         CsPrecontentieuxDechargement dech = new CsPrecontentieuxDechargement();
         if (this.Txt_ReferenceClient.Tag != null)
         {
             dech = GetInfoScream();
         }
         else
         {
             return;
         }
         Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient proxy = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
         proxy.InsererDechargePrecontentieuxAsync(dech);
         proxy.InsererDechargePrecontentieuxCompleted += (ssn, args) =>
         {
             if ((args != null && args.Cancelled) || (args.Error != null))
             {
                 return;
             }
             if (args.Result != null && args.Result == true)
             {
                 Message.ShowInformation("Mise a jour validée", "Info");
             }
             else
             {
                 Message.ShowInformation("Erreur a la mise a jour", "Info");
             }
         };
         proxy.CloseAsync();
     }
     catch (Exception)
     {
         Message.ShowError("Erreur ", "Demande");
     }
 }