private void MiseAJoursDetailCampagne(List <CsDetailCampagnePrecontentieux> Detail)
 {
     try
     {
         RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
         client.MajDetailPrecontentieuxCompleted += (ss, ress) =>
         {
             try
             {
                 if (ress.Cancelled || ress.Error != null)
                 {
                     Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                     return;
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, "Erreur");
             }
         };
         client.MajDetailPrecontentieuxAsync(Detail);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void RechercheDetailCampagne()
 {
     try
     {
         RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
         client.RechercherSuiviCampagnePrecontentieuxCompleted += (ss, ress) =>
         {
             try
             {
                 if (ress.Cancelled || ress.Error != null)
                 {
                     Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                     return;
                 }
                 if (ress.Result != null && ress.Result.Count != 0)
                 {
                     List <CsDetailCampagnePrecontentieux> lstDetail = RetourneDistinctReglement(ress.Result);
                     this.lvwResultat.ItemsSource = null;
                     this.lvwResultat.ItemsSource = lstDetail;
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, "Erreur");
             }
         };
         client.RechercherSuiviCampagnePrecontentieuxAsync(CampagneSelect);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void ChargerMauvaisPayeur(List <int> lstIdCentre, DateTime?Datedebut, DateTime?Datefin)
        {
            try
            {
                prgBar.Visibility = System.Windows.Visibility.Visible;
                RecouvrementServiceClient proxy = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                proxy.ListeDesMoratoiresEmisAsync(lstIdCentre, Datedebut, Datefin, true);
                proxy.ListeDesMoratoiresEmisCompleted += (ssn, results) =>
                {
                    try
                    {
                        this.btn_Rechercher.IsEnabled = true;
                        prgBar.Visibility             = System.Windows.Visibility.Collapsed;
                        if (results.Cancelled || results.Error != null)
                        {
                            string error = results.Error.Message;
                            Message.ShowError("Erreur d'invocation du service. Réessayer svp !", Galatee.Silverlight.Resources.Langue.errorTitle);
                            return;
                        }
                        if (results.Result == null || results.Result.Count == 0)
                        {
                            Message.ShowError("Aucune donnée retournée!", Galatee.Silverlight.Resources.Langue.errorTitle);
                            return;
                        }
                        dataTable = Shared.ClasseMEthodeGenerique.RetourneListCopy <CsDetailMoratoire>(results.Result);
                        List <CsDetailMoratoire> lstMoratoir = dataTable;

                        if (this.Rdb_Echu.IsChecked == true)
                        {
                            lstMoratoir = lstMoratoir.Where(t => t.EXIGIBILITE.Value.Date < System.DateTime.Today.Date).ToList();
                        }
                        foreach (var item in lstMoratoir)
                        {
                            item.REFERENCE = item.CENTRE + " " + item.CLIENT + " " + item.ORDRE;
                            item.NATURE    = (item.EXIGIBILITE.Value.Date < System.DateTime.Today.Date) ? "ECHU" : string.Empty;
                            CsDetailMoratoire le = new CsDetailMoratoire();
                            le = item;
                            if (lstSource.FirstOrDefault(t => t.REFERENCE == le.REFERENCE) != null)
                            {
                                le.REFERENCE = string.Empty;
                                le.NOMABON   = string.Empty;
                            }
                            lstSource.Add(le);
                        }

                        lvwResultat.ItemsSource = null;
                        lvwResultat.ItemsSource = lstSource;
                    }
                    catch (Exception ex)
                    {
                        this.btn_Rechercher.IsEnabled = true;
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void Recherche(List <CsCAMPAGNE> laCampagneSelect)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.ControleCampagneCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }
                        detailcampagnes = args.Result;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
                client.ControleCampagneAsync(laCampagneSelect);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        private void ValiderAnnulationFrais(List <CsDetailCampagne> Lst)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
                client.ValidationAnnulationFraisCompleted += (ss, ress) =>
                {
                    try
                    {
                        if (ress.Cancelled || ress.Error != null)
                        {
                            Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                            return;
                        }

                        if (ress.Result == false)
                        {
                            Message.ShowInformation("Erreur lors de l'insertion des index de campange! Veuillez réessayer svp ", "Informations");
                            return;
                        }
                        btnsearch_Click(null, null);
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
                client.ValidationAnnulationFraisAsync(Lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
        private void UpdateIndexCoupure(CsDetailCampagne Lst)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
                client.UpdateIndexAsync(Lst);
                client.UpdateIndexCompleted += (ss, ress) =>
                {
                    try
                    {
                        if (ress.Cancelled || ress.Error != null)
                        {
                            Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                            return;
                        }

                        if (ress.Result == null)
                        {
                            Message.ShowInformation("Erreur lors de l'insertion des index de campange! Veuillez réessayer svp ", "Informations");
                            return;
                        }
                        this.lvwResultat.ItemsSource = null;
                        btnsearch_Click(null, null);
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 7
0
        private void RetourneFraisPose(string Centre, string Client, string Ordre)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
                client.AutorisationDePaiementCompleted += (ss, ress) =>
                {
                    try
                    {
                        if (ress.Cancelled || ress.Error != null)
                        {
                            Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                            return;
                        }

                        if (ress.Result != null && ress.Result.Count != 0)
                        {
                            lvwResultat.ItemsSource = null;
                            lvwResultat.ItemsSource = ress.Result;
                        }
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
                client.AutorisationDePaiementAsync(Centre, Client, Ordre);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 private void RechercheDetailCampagne(int IdCampagne)
 {
     try
     {
         RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
         client.RetourneDetailPrecontentieuxCompleted += (ss, ress) =>
         {
             try
             {
                 if (ress.Cancelled || ress.Error != null)
                 {
                     Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                     return;
                 }
                 if (ress.Result != null && ress.Result.Count != 0)
                 {
                     List <CsDetailCampagnePrecontentieux> lstDetail = ress.Result;
                     lstDetail.Where(t => t.ISINVITATIONEDITER == true).ToList().ForEach(t => t.STATUSINVITATION = "Déja imprimer");
                     this.lvwResultat.ItemsSource = null;
                     this.lvwResultat.ItemsSource = lstDetail;
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, "Erreur");
             }
         };
         client.RetourneDetailPrecontentieuxAsync(IdCampagne);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// Affiche les impayes d'un client donné
        /// </summary>
        /// <param name="refClient">determine la reference du client </param>
        private void AfficherImpayes(string refClient)
        {
            try
            {
                int debutClient = SessionObject.Enumere.TailleCentre;
                int debutOrdre  = SessionObject.Enumere.TailleCentre + SessionObject.Enumere.TailleClient;

                centre = refClient.Substring(0, SessionObject.Enumere.TailleCentre);
                //client = refClient.Substring(debutClient, SessionObject.Enumere.TailleClient);
                client = refClient.Substring(0, SessionObject.Enumere.TailleClient);
                //ordre = refClient.Substring(debutOrdre, SessionObject.Enumere.TailleOrdre);
                ordre             = refClient.Substring(SessionObject.Enumere.TailleClient, SessionObject.Enumere.TailleOrdre);
                prgBar.Visibility = System.Windows.Visibility.Visible;

                RecouvrementServiceClient srv = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                srv.TestClientExistCompleted += new EventHandler <TestClientExistCompletedEventArgs>(TestClientExist);// Call back sur la methode TestClientTxi
                srv.TestClientExistAsync(centre, client, ordre);
            }
            catch (Exception ex)
            {
                CleanIHM();
                btnOk.IsEnabled = false;
                throw ex;
            }
        }
Ejemplo n.º 10
0
        void RemplirCentre()
        {
            Galatee.Silverlight.ServiceRecouvrement.CsCentre centre;
            RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.Protocole(), Utility.EndPoint("Recouvrement"));

            client.SelectCentreCampagneCompleted += (es, result) =>
            {
                try
                {
                    if (result.Cancelled || result.Error != null)
                    {
                        string error = result.Error.Message;
                        Message.ShowError("Erreur à l'exécution du service", "SelectCentreCampagne");
                        return;
                    }

                    if (result.Result == null || result.Result.Count == 0)
                    {
                        Message.ShowError("Aucune donnée trouvée", "SelectCentreCampagne");
                        return;
                    }

                    List <Galatee.Silverlight.ServiceRecouvrement.CsCentre> lCentre = new List <Galatee.Silverlight.ServiceRecouvrement.CsCentre>();
                    lCentre.AddRange(result.Result);
                    RemplirAgent();
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                }
                // remplir agent combobox
            };
            client.SelectCentreCampagneAsync();
        }
        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;
            }
        }
Ejemplo n.º 12
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");
            }
        }
        public void Save(List <CsLotComptClient> AjustementRecuToUpdate, List <CsLotComptClient> AjustementRecuToInserte, List <CsLotComptClient> AjustementRecuToDelete)
        {
            try
            {
                RecouvrementServiceClient service = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                int handler = LoadingManager.BeginLoading("Mise à jour des données ...");
                service.SaveAjustementAsync(AjustementRecuToUpdate, AjustementRecuToInserte, AjustementRecuToDelete);
                service.SaveAjustementCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            Message.Show("Erreur dans le traitement des méthodes de dectection : " + res.Error.InnerException.ToString(), "Erreur");
                        }
                        else
                        if (res.Result != null)
                        {
                            if (res.Result > 0)
                            {
                                CsLotComptClient Ajustement = ListeAjustement.FirstOrDefault(l => l.PK_ID == 0);
                                if (Ajustement != null)
                                {
                                    int index = ListeAjustement.IndexOf(Ajustement);
                                    Ajustement.PK_ID = res.Result;
                                    Ajustement.DetaiLot.ForEach(c => c.FK_IDLOTCOMPECLIENT = res.Result);

                                    ListeAjustement[index] = Ajustement;
                                }

                                LoadDatagrid();
                                LoadAllAjustement();
                            }
                            else
                            {
                                Message.Show("Sauvegarde non effectuée avec succès,il se peut que vos modifications n'aient pas été prises en compte",
                                             "Info");
                            }
                        }
                        else
                        {
                            Message.Show("Une erreur s'est produite, veuillez consulter le journal des erreurs",
                                         "Erreur");
                        }
                        LoadingManager.EndLoading(handler);
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void LoadAllAjustement()
        {
            try
            {
                ListeAjustement = new ObservableCollection <CsLotComptClient>();
                //if (SessionObject.ListeAjustement.Count > 0)
                //{
                //    foreach (var item in SessionObject.ListeAjustement)
                //    {
                //        ListeAjustement.Add(item);
                //    }
                //    LoadDatagrid();
                //}
                //else
                //{
                RecouvrementServiceClient service = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                int handler = LoadingManager.BeginLoading("Chargement des donnée ...");
                service.LoadAllAjustementAsync();
                service.LoadAllAjustementCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            Message.Show("Erreur dans le traitement des méthode de dectection : " + res.Error.InnerException.ToString(), "Erreur");
                        }
                        else
                        if (res.Result != null)
                        {
                            SessionObject.ListeAjustement = res.Result;
                            foreach (var item in SessionObject.ListeAjustement)
                            {
                                ListeAjustement.Add(item);
                            }
                            LoadDatagrid();
                        }
                        else
                        {
                            Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs",
                                         "Erreur");
                        }
                        LoadingManager.EndLoading(handler);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                };

                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void Recherche(CsCAMPAGNE laCampagneSelect)
        {
            try
            {
                prgBar.Visibility = System.Windows.Visibility.Visible;

                List <CsCAMPAGNE> lesCampagne = new List <CsCAMPAGNE>();
                lesCampagne.Add(laCampagneSelect);
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.ListeDesClientAResilierAsync(lesCampagne);
                client.ListeDesClientAResilierCompleted += (ss, args) =>
                {
                    try
                    {
                        this.btnsearch.IsEnabled = true;
                        prgBar.Visibility        = System.Windows.Visibility.Collapsed;
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result;
                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource   = null;
                        this.lvwResultat.ItemsSource   = lesClientCampagne;
                        this.lvwResultat.SelectedIndex = 0;

                        OKButton.Visibility = System.Windows.Visibility.Visible;
                    }
                    catch (Exception ex)
                    {
                        this.btnsearch.IsEnabled = true;

                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 16
0
        void Recherche(string CodeSite, string IdCampagne, int IdPia, DateTime?DateDebut, DateTime?DateFin, string Centre, string Client, string Ordre)
        {
            try
            {
                if (lesClientCampagne.Count != 0)
                {
                    lesClientCampagne.Clear();
                }
                this.lvwResultat.ItemsSource = null;
                prgBar.Visibility            = System.Windows.Visibility.Visible;
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RechercheClientCampagneCompleted += (ss, args) =>
                {
                    try
                    {
                        prgBar.Visibility = System.Windows.Visibility.Collapsed;
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result;
                        detailcampagnes.ForEach(p => p.INDEX = p.INDEXCOMPTEUR);
                        lesClientCampagne.Clear();
                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource = null;
                        this.lvwResultat.ItemsSource = lesClientCampagne;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
                client.RechercheClientCampagneAsync(CodeSite, IdCampagne, IdPia, DateDebut, DateFin, Centre, Client, Ordre, 6);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 17
0
        void RemplirAgent()
        {
            CTab300 agent;
            RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.Protocole(), Utility.EndPoint("Recouvrement"));

            client.SelectAgentCampagneCompleted += (ss, ee) =>
            {
                try
                {
                    if (ee.Cancelled || ee.Error != null)
                    {
                        string error = ee.Error.Message;
                        Message.Show("Erreur à l'exécution du service", "SelectAgentCampagne");
                        return;
                    }

                    if (ee.Result == null || ee.Result.Count == 0)
                    {
                        Message.Show("Aucune donnée trouvée", "SelectAgentCampagne");
                        return;
                    }

                    List <CTab300> agents = new List <CTab300>();
                    agents.AddRange(ee.Result);

                    if ((agents != null) && (agents.Count > 0))
                    {
                        this.cmbAgent.Items.Clear();
                        foreach (CTab300 a in agents)
                        {
                            agent         = new CTab300();
                            agent.Code    = a.Code;
                            agent.Libelle = a.Libelle;
                            this.cmbAgent.Items.Add(agent);
                        }
                    }
                    //Ligne vide : champ non obligatoire
                    agent      = new CTab300();
                    agent.Code = agent.Libelle = string.Empty;
                    this.cmbAgent.Items.Add(agent);

                    this.cmbAgent.SelectedValue     = "Code";
                    this.cmbAgent.DisplayMemberPath = "Libelle";
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                }
            };
            client.SelectAgentCampagneAsync();
        }
        private void ValiderSuppression()
        {
            List <CsDetailMoratoire> lstDistinctFactureDuMoratoire = listeDetailsMoratoires.Where(t => t.IDMORATOIRE == int.Parse(idmoratoireselected)).ToList();

            RecouvrementServiceClient clients = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));

            clients.VerifiePaiementMoratoireCompleted += (send, res) =>
            {
                //impression du recu du moratoire
                try
                {
                    prgBar.Visibility = System.Windows.Visibility.Visible;
                    if (res.Cancelled || res.Error != null)
                    {
                        Message.ShowError("Erreur survenue lors de l'appel serveur.", "Erreur");
                        CleanIHM();
                        return;
                    }
                    if (res.Result == null)
                    {
                        Message.ShowError("Erreur survenue lors de la suppcression du moratoire.Réessayer svp!", Galatee.Silverlight.Resources.Langue.errorTitle);
                        CleanIHM();
                        return;
                    }
                    List <CsDetailMoratoire> lstMoratoirePayer = new List <CsDetailMoratoire>();

                    if (res.Result.Count == 0)
                    {
                        lstMoratoirePayer = res.Result;
                        MiseAJoureMoratoire(lstDistinctFactureDuMoratoire, lstMoratoirePayer);
                    }
                    else
                    {
                        var ws = new MessageBoxControl.MessageBoxChildWindow("Recouvrement", Galatee.Silverlight.Resources.Langue.MsgImpossibleDeSupprimerMor, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
                        ws.OnMessageBoxClosed += (l, results) =>
                        {
                            if (ws.Result == MessageBoxResult.OK)
                            {
                                MiseAJoureMoratoire(lstDistinctFactureDuMoratoire, lstMoratoirePayer);
                            }
                        };
                        ws.Show();
                    }
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, "Erreur");
                }
            };
            clients.VerifiePaiementMoratoireAsync(int.Parse(idmoratoireselected));
        }
Ejemplo n.º 19
0
        void Recherche(CsCAMPAGNE laCampagneSelect, CsClient LeClientRechercheSelect)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RetourneDonneeAnnulationFraisAsync(laCampagneSelect, LeClientRechercheSelect);
                client.RetourneDonneeAnnulationFraisCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "Recouvrement");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "Recouvrement");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result.Where(t => t.ISNONENCAISSABLE != null).ToList();
                        if (detailcampagnes.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "Recouvrement");
                            return;
                        }
                        lesClientCampagne.Clear();
                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource = null;
                        this.lvwResultat.ItemsSource = lesClientCampagne;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void btnprint_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <int> lstCentre = new List <int>();
                List <int> lst       = new List <int>();
                if (this.txt_libellecentre.Tag != null)
                {
                    //lstCentre.AddRange(((List<ServiceAccueil.CsCentre>)this.txt_libellecentre.Tag).Select(p => p.PK_ID).ToList());
                    lstCentre.AddRange(((List <int>) this.txt_libellecentre.Tag).ToList());
                }
                else
                {
                    lstCentre.AddRange(LstCentrePerimetre.Select(u => u.PK_ID).ToList());
                }

                DateTime?dateDebut = string.IsNullOrEmpty(this.dtp_debut.Text) ? null : this.dtp_debut.SelectedDate;
                DateTime?dateFin   = string.IsNullOrEmpty(this.dtp_fin.Text) ? null : this.dtp_fin.SelectedDate;
                int      Nombre    = int.Parse(this.txtParametre.Text);

                RecouvrementServiceClient proxy = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                proxy.ListeDesChequesImpayesCompleted += (senders, results) =>
                {
                    if (results.Cancelled || results.Error != null)
                    {
                        Message.Show("errror occurs while calling remote method", "Recouvrement");
                        return;
                    }

                    if (results.Result == null || results.Result.Count == 0)
                    {
                        Message.Show("Aucune donnée trouvée", "Recouvrement");
                        return;
                    }

                    List <ServiceRecouvrement.CsDetailCampagne> dataTable = new List <ServiceRecouvrement.CsDetailCampagne>();
                    dataTable.AddRange(results.Result);

                    lvwResultat.ItemsSource = null;
                    lvwResultat.ItemsSource = dataTable;
                };
                proxy.ListeDesChequesImpayesAsync(lstCentre, dateDebut, dateFin, Nombre);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                Message.Show(ex.Message, "Recouvrement");
                return;
            }
        }
        void Recherche(string CodeSite, string Centre, string Client, string Ordre)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RechercheClientCampagneScgcCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result;

                        this.txtCentre.Text          = string.Empty;
                        this.txtOrdeClient.Text      = string.Empty;
                        this.txtReferenceClient.Text = string.Empty;

                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource = null;
                        this.lvwResultat.ItemsSource = lesClientCampagne;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
                client.RechercheClientCampagneScgcAsync(CodeSite, Centre, Client, Ordre, 1);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void RemplirCentre()
        {
            CsCentre centre;
            RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));

            client.SelectCentreCampagneCompleted += (es, result) =>
            {
                if (result.Cancelled || result.Error != null)
                {
                    string error = result.Error.Message;
                    MessageBox.Show("Erreur à l'exécution du service", "SelectCentreCampagne", MessageBoxButton.OK);
                    return;
                }

                if (result.Result == null || result.Result.Count == 0)
                {
                    MessageBox.Show("Aucune donnée trouvée", "SelectCentreCampagne", MessageBoxButton.OK);
                    return;
                }

                List <CsCentre> lCentre = new List <CsCentre>();
                lCentre.AddRange(result.Result);

                if ((lCentre != null) && (lCentre.Count > 0))
                {
                    this.cmbCentre.Items.Clear();
                    this.cmbCentre.DisplayMemberPath = "LIBELLE";
                    this.cmbCentre.SelectedValuePath = "CODE";
                    foreach (CsCentre a in lCentre)
                    {
                        centre         = new CsCentre();
                        centre.CODE    = a.CODE;
                        centre.LIBELLE = a.LIBELLE;
                        this.cmbCentre.Items.Add(centre);
                    }
                }
                //Ligne vide : champ non obligatoire
                centre      = new CsCentre();
                centre.CODE = centre.LIBELLE = "    ";      // string.Empty;
                this.cmbCentre.Items.Add(centre);

                this.cmbCentre.DisplayMemberPath = "LIBELLE";
                this.cmbCentre.SelectedValue     = "CODE";
                // remplir agent combobox
            };
            client.SelectCentreCampagneAsync();
        }
        private void InsertionIndexCoupure(List <CsDetailCampagne> Lst)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
                client.InsertListIndexCompleted += (ss, ress) =>
                {
                    try
                    {
                        if (ress.Cancelled || ress.Error != null)
                        {
                            Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                            return;
                        }

                        if (ress.Result == null)
                        {
                            Message.ShowInformation("Erreur lors de l'insertion des index de campange! Veuillez réessayer svp ", "Informations");
                            return;
                        }
                        NbrElet++;
                        if (NbrElet == 5)
                        {
                            RemoveElementGridApresInsert();
                        }
                        else
                        {
                            ReloadDatagraid();
                        }

                        this.txt_index.Text = string.Empty;
                        this.txt_index.Focus();
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
                client.InsertListIndexAsync(Lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void Recherche()
        {
            try
            {
                btnsearch.IsEnabled = false;
                aClient critere = new aClient();
                critere.Centre = (string.IsNullOrEmpty(this.txtCentre.Text)) ? string.Empty : this.txtCentre.Text;
                critere.Client = (string.IsNullOrEmpty(this.txtClient.Text)) ? string.Empty : this.txtClient.Text;
                critere.Ordre  = (string.IsNullOrEmpty(this.txtOrdre.Text)) ? string.Empty : this.txtOrdre.Text;

                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RechercherListeClientsCompleted += (ss, args) =>
                {
                    if (args.Cancelled || args.Error != null)
                    {
                        string error = args.Error.Message;
                        MessageBox.Show(args.Error.Message, "RechercherListeClients", MessageBoxButton.OK);
                        btnsearch.IsEnabled = true;
                        return;
                    }

                    if (args.Result == null || args.Result.Count == 0)
                    {
                        MessageBox.Show("Aucune donnée trouvée", "RechercherListeClients", MessageBoxButton.OK);
                        btnsearch.IsEnabled = true;
                        return;
                    }

                    List <aClient> clients = new List <aClient>();
                    clients.AddRange(args.Result);

                    this.lvwResultat.ItemsSource = null;
                    this.lvwResultat.ItemsSource = clients;
                    btnsearch.IsEnabled          = true;
                };
                client.RechercherListeClientsAsync(critere);
            }
            catch (Exception ex)
            {
                btnsearch.IsEnabled = true;
                string error = ex.Message;
                //MessageBox.Show(ex.Message, Program.rm.GetString("msgSuiviRecouvrements"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 private void InsererCompteClient(List <CsLclient> leFrais)
 {
     try
     {
         RecouvrementServiceClient clients = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
         clients.InsererFraisPoseAsync(leFrais);
         clients.InsererFraisPoseCompleted += (es, result) =>
         {
             try
             {
                 if (result.Cancelled || result.Error != null)
                 {
                     string error = result.Error.Message;
                     Message.ShowError("Erreur à l'exécution du service", "InsererCompteClient");
                     return;
                 }
                 if (result.Result == null)
                 {
                     Message.ShowInformation("Donnée non trouvé ", "InsererCompteClient");
                     return;
                 }
                 if (string.IsNullOrEmpty(result.Result))
                 {
                     Message.ShowInformation("Mise a jour effectuée", "Recouvrement");
                 }
                 else
                 {
                     Message.ShowInformation(result.Result, "Recouvrement");
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
             }
         };
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void CreeCampagnePrecontentieux(int idcentre, DateTime?DateDebut, DateTime?DateFin, decimal SoldeDu)
        {
            try
            {
                prgBar.Visibility = System.Windows.Visibility.Visible;
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.CREE_CAMPAGNE_PRECONTENTIEUXCompleted += (es, result) =>
                {
                    try
                    {
                        prgBar.Visibility = System.Windows.Visibility.Collapsed;
                        if (result.Cancelled || result.Error != null)
                        {
                            string error = result.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SelectCentreCampagne");
                            return;
                        }

                        if (result.Result == null)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SelectCentreCampagne");
                            return;
                        }
                        List <CsDetailCampagnePrecontentieux> lesCampagne = result.Result;
                        Dictionary <string, string>           param       = new Dictionary <string, string>();
                        param.Add("pUser", UserConnecte.nomUtilisateur);
                        Utility.ActionDirectOrientation <ServicePrintings.CsDetailCampagnePrecontentieux, ServiceRecouvrement.CsDetailCampagnePrecontentieux>(lesCampagne, param, SessionObject.CheminImpression, "CampagnePrecontentieux", "Precontentieux", true);
                        this.DialogResult = true;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
                client.CREE_CAMPAGNE_PRECONTENTIEUXAsync(idcentre, DateDebut, DateFin, SoldeDu, UserConnecte.PK_ID, UserConnecte.matricule);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ValiderAutorisation(List <CsDetailCampagne> Lst)
        {
            try
            {
                CsDetailCampagne          leClient = (CsDetailCampagne)lvwResultat.SelectedItem;
                RecouvrementServiceClient client   = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
                client.ValidationAutorisationFraisCompleted += (ss, ress) =>
                {
                    try
                    {
                        if (ress.Cancelled || ress.Error != null)
                        {
                            Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                            return;
                        }

                        if (ress.Result == false)
                        {
                            Message.ShowInformation("Erreur lors de l'insertion des index de campagne! Veuillez réessayer svp ", "Informations");
                            return;
                        }
                        if (ress.Result == true)
                        {
                            Message.ShowInformation("Mise à jour validée ", "Informations");
                            ReloadDatagraid();
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
                client.ValidationAutorisationFraisAsync(Lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         List <CsDetailCampagne> lstClientEnRendezVous = lesClientCampagne.Where(t => t.DATERENDEZVOUS != null).ToList();
         if (lstClientEnRendezVous == null || lstClientEnRendezVous.Count == 0)
         {
             return;
         }
         RecouvrementServiceClient Service = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
         Service.SaveRDVCoupureCompleted += (ss, args) =>
         {
             try
             {
                 if (args.Cancelled || args.Error != null)
                 {
                     string error = args.Error.Message;
                     Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                     return;
                 }
                 if (args.Result == null)
                 {
                     Message.ShowInformation("Aucune données trouvée ", "SearchCampagne");
                     return;
                 }
                 btnsearch_Click(null, null);
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
             }
         };
         Service.SaveRDVCoupureAsync(lstClientEnRendezVous);
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
        void Recherche(DateTime?datedebut, DateTime?datefin)
        {
            try
            {
                detailcampagnes         = new List <CsDetailCampagne>();
                lvwResultat.ItemsSource = null;
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.EditerCLientaPoserAsync(datedebut, datefin);
                client.EditerCLientaPoserCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }
                        detailcampagnes         = args.Result;
                        lvwResultat.ItemsSource = null;
                        lvwResultat.ItemsSource = detailcampagnes;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void Recherche(string CodeSite, string IdCampagne, int IdPia, DateTime?DateDebut, DateTime?DateFin)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RechercheCampagneAsync(CodeSite, IdCampagne, IdPia, DateDebut, DateFin, 1);
                client.RechercheCampagneCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }

                        List <CsCAMPAGNE> campagnes = new List <CsCAMPAGNE>();
                        campagnes = args.Result;
                        this.lvwResultat.ItemsSource = null;
                        this.lvwResultat.ItemsSource = campagnes;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }