protected void CmbCollector_SelectedIndexChanged(object sender, EventArgs e) { int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... "); ReportServiceClient service = new ReportServiceClient(Utility.Protocole(), Utility.EndPoint("Report")); CsReglement reglementSelection = listeDeReglement.ElementAt(CmbCollector.SelectedIndex); List <CsReglement> liste = new List <CsReglement>(); service.SelectionDateParAgentAsync(reglementSelection.MATRICULE.ToString()); service.SelectionDateParAgentCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { LoadingManager.EndLoading(loaderHandler); throw new Exception("Cannot display report"); } if (res.Result != null) { liste = res.Result; //List<CsReglement> liste = service.SelectionAgentParNom(Matricule); if (liste != null || liste.Count > 0) { listeDeReglement = liste; foreach (CsReglement reg in liste) { this.CmbDatePayment.Items.Add(reg.DATEENCAISSEMENT.ToString()); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { LoadingManager.EndLoading(loaderHandler); } }; }