private void ChargerCompteDeResiliation(CsClient _UnClient) { AcceuilServiceClient client = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); client.ChargerCompteDeResiliationCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null || args.Result.Count == 0) { return; } List <CsLclient> lstFactureDuClient = args.Result; lstFactureDuClient.ForEach(t => t.REFEM = (!string.IsNullOrEmpty(t.REFEM)? ClasseMEthodeGenerique.FormatPeriodeMMAAAA(t.REFEM):string.Empty)); if (lstFactureDuClient != null && lstFactureDuClient.Count != 0) { AfficherOuMasquer(tabItemCompteClient, true); dtg_CompteClient.ItemsSource = null; dtg_CompteClient.ItemsSource = lstFactureDuClient; lstFactureDuClient.ForEach(i => i.MONTANTPAYPARTIEL = ((i.MONTANT == null ? 0 : i.MONTANT) - (i.SOLDEFACTURE == null ? 0 : i.SOLDEFACTURE))); Txt_TotalSoldeResil.Text = lstFactureDuClient.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant); } }; client.ChargerCompteDeResiliationAsync(_UnClient); client.CloseAsync(); }
private void ChargerCompteDeResiliation(CsClient _UnClient) { try { AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.ChargerCompteDeResiliationCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null || args.Result.Count == 0) { Message.ShowInformation("Ce client n'existe pas", "Demande"); return; } lstFactureDuClient = new List <CsLclient>(); lstFactureDuClient = args.Result; lstFactureDuClient.ForEach(t => t.REFEM = ClasseMEthodeGenerique.FormatPeriodeMMAAAA(t.REFEM)); if (lstFactureDuClient != null && lstFactureDuClient.Count != 0) { AfficherOuMasquer(tabItemCompte, true); dtg_CompteClient.ItemsSource = lstFactureDuClient; //Txt_TotalSoldeResil.Text = lstFactureDuClient.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant); Txt_TotalSoldeResil.Text = lstFactureDuClient.First().SOLDEFACTURE.Value.ToString(SessionObject.FormatMontant); //if (lstFactureDuClient.Sum(t => t.SOLDEFACTURE) >= 0) if (lstFactureDuClient.First().SOLDEFACTURE >= 0) { Message.ShowInformation("Aucun remboursement prevu pour ce client", "Demande"); this.OKButton.IsEnabled = false; return; } this.OKButton.IsEnabled = true; } }; client.ChargerCompteDeResiliationAsync(_UnClient); client.CloseAsync(); } catch (Exception ex) { Message.ShowError("Erreur au chargement des cout", "Demande"); } }
private void ChargerCompteDeResiliation(CsClient _UnClient) { AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.ChargerCompteDeResiliationCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null || args.Result.Count == 0) { //Message.ShowInformation("Ce client n'existe pas", "Demande"); //return; Message.ShowInformation("Ce client n'a pas d'avance positionnée.\nVeuillez vérifier l'abonnement .", "Acceuil"); this.OKButton.IsEnabled = false; // return; } List <CsLclient> lstFactureDuClient = args.Result; if (lstFactureDuClient != null && lstFactureDuClient.Count != 0) { lstFactureDuClient.ForEach(t => t.REFEM = ClasseMEthodeGenerique.FormatPeriodeMMAAAA(t.REFEM)); AfficherOuMasquer(tabItemCompte, true); dtg_CompteClient.ItemsSource = lstFactureDuClient; //Txt_TotalSoldeResil.Text = lstFactureDuClient.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant); Txt_TotalSoldeResil.Text = lstFactureDuClient.First().SOLDEFACTURE.Value.ToString(SessionObject.FormatMontant); //if (lstFactureDuClient.Sum(t => t.SOLDEFACTURE) >= 0) //{ // Message.ShowInformation("Aucun remboursement pour ce client car le solde est supperieur a 0", "Demande"); // this.OKButton.IsEnabled = false; // return; //} this.OKButton.IsEnabled = true; } }; client.ChargerCompteDeResiliationAsync(_UnClient); client.CloseAsync(); }