private void MiseAjourDemandeAnnulation(List <ServiceCaisse.CsLclient> leReglement) { CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint(this)); service.DemandeAnnulationEncaissementAsync(leReglement); service.DemandeAnnulationEncaissementCompleted += (sender, es) => { try { if (es.Cancelled || es.Error != null || es.Result == null) { Message.ShowError("Erreur d'annulation du reçu. Veuillez réessayer svp !", Langue.errorTitle); return; } List <ServiceCaisse.CsLclient> lstInitData1 = (List <ServiceCaisse.CsLclient>) this.dtg_FactureAjouter.ItemsSource; lstInitData1.AddRange(_LstrefReglement.Where(t => t.ACQUIT == leReglement.First().ACQUIT)); List <ServiceCaisse.CsLclient> lstReglementAjouter = RetourneEltsDataGrid2(lstInitData1); dtg_FactureAjouter.ItemsSource = null; dtg_FactureAjouter.ItemsSource = lstReglementAjouter; List <ServiceCaisse.CsLclient> lstInitData2 = (List <ServiceCaisse.CsLclient>) this.dtg_FactureAAnnule.ItemsSource; List <ServiceCaisse.CsLclient> lstAAfficher = new List <ServiceCaisse.CsLclient>(); lstInitData2.RemoveAll(t => t.ACQUIT == leReglement.First().ACQUIT); dtg_FactureAAnnule.ItemsSource = null; dtg_FactureAAnnule.ItemsSource = lstInitData2; } catch (Exception ex) { Message.ShowError(ex, Langue.errorTitle); } }; }