public void LoadAllCoperTypeCoper() { try { InterfaceComptableServiceClient service = new InterfaceComptableServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("InterfaceComptable")); service.RetourneCoper_TypeCompteCompleted += (s, args) => { try { if (args.Cancelled || args.Error != null || args.Result == null) { string error = args.Error.InnerException.ToString(); return; } else if (args.Result != null && args.Result.Count != 0) { args.Result.ForEach(t => List_Coper_Type_Compte.Add(t)); LoadDatagrid(); } else { Message.ShowInformation("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Avertissement"); } } catch (Exception ex) { throw ex; } }; service.RetourneCoper_TypeCompteAsync(); } catch (Exception ex) { throw ex; } }
private void LoadDatagrid() { //SessionObject.ListeCompteSpecifique = ListeCompteSpecifique.ToList(); System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(List_Coper_Type_Compte.OrderBy(r => r.LIBELLE_COPER)); dgListeCompteSpecifique.ItemsSource = view; datapager.Source = view; }