private void Button_Click(object sender, RoutedEventArgs e) { allowProgressBar(); CsClient leClient = new CsClient(); leClient.CENTRE = txt_centre.Text; leClient.REFCLIENT = txt_client.Text; leClient.ORDRE = txt_ordre.Text; if (string.IsNullOrWhiteSpace(txt_centre.Text) || string.IsNullOrWhiteSpace(txt_client.Text) || string.IsNullOrWhiteSpace(txt_ordre.Text)) { Message.ShowInformation("Le centre ,la reference client et l'ordre sont obligatoire", "Information"); return; } Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement")); service.RetourneListeFactureNonSoldeGCAsync(leClient); service.RetourneListeFactureNonSoldeGCCompleted += (s, args) => { if (args != null && args.Cancelled) { Message.ShowError("Une erreur est survenu lors du traitement", "Erreur"); } if (args.Result == null || args.Result.Count <= 0) { Message.ShowInformation("Aucune données corresponte aux critères", "Information"); } var ItemsSource = args.Result; if (!string.IsNullOrEmpty(this.txt_periode.Text)) { ItemsSource = ItemsSource.Where(t => t.REFEM == this.txt_periode.Text).ToList(); } if (!string.IsNullOrEmpty(this.txt_periode.Text)) { ItemsSource = ItemsSource.Where(t => t.NDOC == this.txt_Num_Fac.Text).ToList(); } dg_facture.ItemsSource = ItemsSource; desableProgressBar(); return; }; }