private void ChargerClientFromReference(string ReferenceClient)
 {
     try
     {
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
         service.RetourneClientByReferenceCompleted += (s, args) =>
         {
             if ((args != null && args.Cancelled) || (args.Error != null))
             {
                 return;
             }
             if (args.Result != null && args.Result.Count > 1)
             {
                 List <object> _Listgen = ClasseMEthodeGenerique.RetourneListeObjet(args.Result);
                 Galatee.Silverlight.MainView.UcListeGenerique ctr = new Galatee.Silverlight.MainView.UcListeGenerique(_Listgen, "CENTRE", "LIBELLESITE", "Liste des site");
                 ctr.Show();
                 ctr.Closed += new EventHandler(galatee_OkClickedChoixClient);
             }
             else
             {
                 ChargeDetailDEvis(args.Result.First());
             }
         };
         service.RetourneClientByReferenceAsync(ReferenceClient, lstIdCentre);
         service.CloseAsync();
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #2
0
 private void ChargerClientFromReference(string ReferenceClient)
 {
     try
     {
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.RetourneClientByReferenceCompleted += (s, args) =>
         {
             if ((args != null && args.Cancelled) || (args.Error != null))
             {
                 return;
             }
             if (args.Result != null && args.Result.Count > 1)
             {
                 List <object> _Listgen = ClasseMEthodeGenerique.RetourneListeObjet(args.Result);
                 Galatee.Silverlight.MainView.UcListeGenerique ctr = new Galatee.Silverlight.MainView.UcListeGenerique(_Listgen, "CENTRE", "LIBELLESITE", "Liste des site");
                 ctr.Show();
                 ctr.Closed += new EventHandler(galatee_OkClickedChoixClient);
             }
             else
             {
                 CsClient leClient = args.Result.First();
                 leClient.TYPEDEMANDE = Tdem;
                 VerifieExisteDemande(leClient);
             }
         };
         service.RetourneClientByReferenceAsync(ReferenceClient, lstIdCentre);
         service.CloseAsync();
     }
     catch (Exception)
     {
         prgBar.Visibility = System.Windows.Visibility.Collapsed;
         Message.ShowError("Erreur au chargement des données", "Demande");
     }
 }
        private void ChargerClientFromReference(CsDemandeBase dem)
        {
            try
            {
                List <int> lstIdCentre = new List <int>();
                lstIdCentre.Add(dem.FK_IDCENTRE);

                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.RetourneClientByReferenceCompleted += (s, args) =>
                {
                    if ((args != null && args.Cancelled) || (args.Error != null))
                    {
                        Message.ShowError("Erreur au chargement des données", "Demande");
                        return;
                    }
                    if (args.Result != null && args.Result.Count == 0)
                    {
                        Message.ShowError("Aucun client ne correspond à la référence", "Demande");
                        return;
                    }
                    if (args.Result != null && args.Result.Count > 0)
                    {
                        List <CsClient> lesClients = args.Result;
                        bool            isActif    = false;

                        foreach (CsClient st in lesClients)
                        {
                            if (st.DRES == null)
                            {
                                Message.ShowWarning("Il existe un abonnement actif sur cette référence.", "Accueil");
                                isActif = true;
                                break;
                            }
                        }

                        if (isActif)
                        {
                            this.Close();
                            return;
                        }

                        laDemandeSelect = laDetailDemande.LaDemande;
                        RenseignerInformationsDevis(laDetailDemande);
                        RenseignerInformationsDemandeDevis(laDetailDemande);
                        RenseignerInformationsAppareilsDevis(laDetailDemande);
                        RenseignerInformationsFournitureDevis(laDetailDemande);
                        RenseignerInformationsAbonnement(laDetailDemande);
                        RenseignerInformationsBrt(laDetailDemande);
                        RenseignerInformationsDocumentScanne();

                        LayoutRoot.Cursor = Cursors.Arrow;
                    }
                };
                service.RetourneClientByReferenceAsync(dem.CLIENT, lstIdCentre);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }