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; } }
private void ChargerListeDeProduit() { try { if (SessionObject.ListeDesProduit.Count != 0) { LstDeProduit = SessionObject.ListeDesProduit; return; } else { 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; LstDeProduit = SessionObject.ListeDesProduit; }; service1.ListeDesProduitAsync(); service1.CloseAsync(); } } catch (Exception ex) { Message.ShowError(ex.Message, "ChargerListeDeProduit"); } }