private void ChargerMotifRejetCheque()
        {
            try
            {
                if (SessionObject.LstMotifRejetsCheque.Count != 0)
                {
                    Cbo_MotifRejet.ItemsSource       = null;
                    Cbo_MotifRejet.ItemsSource       = SessionObject.LstMotifRejetsCheque;
                    Cbo_MotifRejet.DisplayMemberPath = "LIBELLE";

                    return;
                }
                RecouvrementServiceClient service = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                service.RetourneMotifChequeImpayeCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    SessionObject.LstMotifRejetsCheque = args.Result;

                    Cbo_MotifRejet.ItemsSource       = null;
                    Cbo_MotifRejet.ItemsSource       = SessionObject.LstMotifRejetsCheque;
                    Cbo_MotifRejet.DisplayMemberPath = "LIBELLE";

                    return;
                };
                service.RetourneMotifChequeImpayeAsync();
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        private void AfficherImpayes()
        {
            try
            {
                this.Lsv_ListFacture.ItemsSource = null;
                if (this.Txt_LibelleCentre.Tag != null)
                {
                    _UnClient.CENTRE      = ((ServiceAccueil.CsCentre) this.Txt_LibelleCentre.Tag).CODE;
                    _UnClient.REFCLIENT   = this.txtReferenceClient.Text;
                    _UnClient.ORDRE       = this.txtOrdeClient.Text;
                    _UnClient.FK_IDCENTRE = ((ServiceAccueil.CsCentre) this.Txt_LibelleCentre.Tag).PK_ID;
                }
                else
                {
                    Message.ShowInformation("Sélectionnez le centre", "Index");
                    return;
                }
                prgBar.Visibility = System.Windows.Visibility.Visible;

                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RetourneListeFactureNonSoldeCaisseAsync(_UnClient);
                client.RetourneListeFactureNonSoldeCaisseCompleted += (s, args) =>
                {
                    prgBar.Visibility = System.Windows.Visibility.Collapsed;
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    if (args.Result == null || args.Result.Count == 0)
                    {
                        Message.ShowInformation("Ce client n'existe pas", "Rendeez-vous");
                        return;
                    }
                    List <CsLclient> lstFactureDuClient = args.Result;
                    lstFactureDuClient.ForEach(t => t.REFEMNDOC = t.REFEM);
                    List <CsClient> LstClientDeLaReference = MethodeGenerics.RetourneClientFromFacture(lstFactureDuClient);

                    lstFactureDuClient.ForEach(t => t.REFEM = ClasseMEthodeGenerique.FormatPeriodeMMAAAA(t.REFEM));
                    foreach (var item in lstFactureDuClient)
                    {
                        item.MONTANTPAYPARTIEL = item.MONTANT - item.SOLDEFACTURE;
                        if (item.MONTANTPAYPARTIEL < 0)
                        {
                            item.MONTANTPAYPARTIEL = 0;
                        }
                    }
                    lstFactureDuClient.ForEach(t => t.MONTANTPAYPARTIEL = t.MONTANT - t.SOLDEFACTURE);
                    this.Txt_SoldeClient.Text   = lstFactureDuClient.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
                    _UnClient.PK_ID             = lstFactureDuClient.First().FK_IDCLIENT;
                    Lsv_ListFacture.ItemsSource = null;
                    Lsv_ListFacture.ItemsSource = lstFactureDuClient.Where(t => t.FK_IDCLIENT == lstFactureDuClient.First().FK_IDCLIENT);
                };
                client.CloseAsync();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, "Rendez-vous");
            }
        }