Ejemplo n.º 1
0
 private void ChargerListeDeProduit()
 {
     try
     {
         if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count != 0)
         {
             return;
         }
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service1.ListeDesProduitCompleted += (sr, res) =>
         {
             if (res != null && res.Cancelled)
             {
                 return;
             }
             SessionObject.ListeDesProduit = res.Result;
         };
         service1.ListeDesProduitAsync();
         service1.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void ChargerProduit()
        {
            try
            {
                if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count > 0)
                {
                    this.CboProduit.ItemsSource       = SessionObject.ListeDesProduit;
                    this.CboProduit.DisplayMemberPath = "LIBELLE";
                    this.CboProduit.SelectedValuePath = "PK_ID";
                    return;
                }
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.ListeDesProduitCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    SessionObject.ListeDesProduit = args.Result;

                    this.CboProduit.ItemsSource       = SessionObject.ListeDesProduit;
                    this.CboProduit.DisplayMemberPath = "LIBELLE";
                    this.CboProduit.SelectedValuePath = "PK_ID";
                };
                service.ListeDesProduitAsync();
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        private void ChargerProduit()
        {
            try
            {
                if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count != 0)
                {
                    Cbo_Produit.ItemsSource       = null;
                    Cbo_Produit.DisplayMemberPath = "LIBELLE";
                    Cbo_Produit.ItemsSource       = SessionObject.ListeDesProduit;

                    return;
                }
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service1.ListeDesProduitCompleted += (sr, res) =>
                {
                    if (res != null && res.Cancelled)
                    {
                        return;
                    }
                    SessionObject.ListeDesProduit = res.Result;
                    Cbo_Produit.ItemsSource       = null;
                    Cbo_Produit.DisplayMemberPath = "LIBELLE";
                    Cbo_Produit.ItemsSource       = SessionObject.ListeDesProduit;
                };
                service1.ListeDesProduitAsync();
                service1.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }