public void InsererAffectation(List <CsRemiseScelles> lstScelleTouInsert, int passage, int NombreDeBoucle)
 {
     try
     {
         int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
         service.InsertRemiseCompleted += (snder, insertR) =>
         {
             LoadingManager.EndLoading(res);
             if (insertR.Cancelled ||
                 insertR.Error != null)
             {
                 Message.ShowError(insertR.Error.Message, Languages.Commune);
                 return;
             }
             if (insertR.Result == 0)
             {
                 Message.ShowError(Languages.ErreurInsertionDonnees, Languages.Commune);
                 return;
             }
             if (passage == NombreDeBoucle)
             {
                 this.OKButton.IsEnabled = true;
                 InitControl();
             }
         };
         service.InsertRemiseAsync(lstScelleTouInsert);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
        private void RetourneHistoriqueClient(int idClient)
        {
            int response = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);

            this.dtg_HistoriquePassWord.ItemsSource = null;
            AdministrationServiceClient client = new AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));

            client.RetourneHistoriqueConnectionCompleted += (ss, res) =>
            {
                if (res.Cancelled || res.Error != null)
                {
                    string error = res.Error.Message;
                    Message.ShowError(error, Galatee.Silverlight.Resources.Langue.errorTitle);
                    LoadingManager.EndLoading(response);
                    return;
                }
                if (res.Result == null)
                {
                    Message.ShowInformation(Galatee.Silverlight.Resources.Langue.msgNodata, Galatee.Silverlight.Resources.Langue.informationTitle);
                    LoadingManager.EndLoading(response);
                    return;
                }
                List <CsHistoriquePassword> lstresult = res.Result;
                lstresult = lstresult.Where(c => c.DATECREATION != null).ToList();
                lstresult = lstresult.OrderByDescending(x => x.DATECREATION).ToList();
                dtg_HistoriquePassWord.ItemsSource = null;
                dtg_HistoriquePassWord.ItemsSource = lstresult;
                dtg_HistoriquePassWord.Tag         = lstresult;


                LoadingManager.EndLoading(response);
            };
            client.RetourneHistoriqueConnectionAsync(idClient);
        }
        private void RetourneDetailDemande(CsDemandeBase laDemandeSelect)
        {
            int res = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                AcceuilServiceClient service = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.GetDemandeByNumIdDemandeCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    LaDemande = args.Result;
                    LoadingManager.EndLoading(res);


                    ListeSortieMateriel(LaDemande);
                    ListeSortieAutreMateriel(LaDemande);
                    dgDemande.ItemsSource = LaDemande.LstCanalistion;
                };
                service.GetDemandeByNumIdDemandeAsync(laDemandeSelect.PK_ID);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LstDemandeValide = new List <CsCanalisation>();
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
        private void DefacturationLot(List <CsLotri> ListLotSelect)
        {
            int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);

            try
            {
                CsStatFacturation        _laStat = new CsStatFacturation();
                FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));
                service.DemandeDefacturerLotAsync(ListLotSelect);

                service.DemandeDefacturerLotCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    if (args.Result == true)
                    {
                        Message.Show("Demande de défacturation effectuée avec succès", "facturation");
                    }
                    else
                    {
                        Message.Show("Une erreur s'est produite lors de la demande ", "facturation");
                    }
                    LoadingManager.EndLoading(res);
                    this.DialogResult = true;
                };
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
        private void ListeDesTransactions(CsHabilitationCaisse laCaisse)
        {
            int handler = LoadingManager.BeginLoading("Traitement en cours ...");

            try
            {
                if (!string.IsNullOrWhiteSpace(TxtDateCaisse.Text))
                {
                    DateTime debut = DateTime.Today;
                    DateTime fin   = (DateTime.Today.AddDays(1));

                    CaisseServiceClient proxy = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                    proxy.LitseDesTransactionAsync(laCaisse);
                    proxy.LitseDesTransactionCompleted += (senders, results) =>
                    {
                        if (results.Cancelled || results.Error != null)
                        {
                            string error = results.Error.Message;
                            MessageBox.Show("errror occurs while calling remote method", "ReportListeEncaissements", MessageBoxButton.OK);
                            return;
                        }
                        if (results.Result == null || results.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "Caisse");
                            return;
                        }

                        List <ServiceCaisse.CsLclient> dataTable = new List <ServiceCaisse.CsLclient>();
                        List <ServiceCaisse.CsLclient> tri       = new List <ServiceCaisse.CsLclient>();
                        dataTable.AddRange(results.Result);

                        tri   = results.Result.OrderBy(t => t.DTRANS).ToList();
                        debut = tri[0].DTRANS.Value;
                        fin   = tri[tri.Count - 1].DTRANS.Value;


                        Dictionary <string, string> param = new Dictionary <string, string>();
                        param.Add("pUser", !string.IsNullOrWhiteSpace(SessionObject.LaCaisseCourante.MATRICULE) ? "Matricule : " + SessionObject.LaCaisseCourante.NOMCAISSE  : "Matricule :Aucun");
                        param.Add("pDateDebut", "Date debut : " + debut);
                        param.Add("pDateFin", "Date fin : " + fin);

                        string key = Utility.getKey();
                        Utility.ActionDirectOrientation <ServicePrintings.CsLclient, ServiceCaisse.CsLclient>(dataTable, param, SessionObject.CheminImpression, "ListeDesTransactions".Trim(), "Caisse".Trim(), true);
                        LoadingManager.EndLoading(handler);
                    };
                }
                else
                {
                    Message.Show("Veuillez choisir un utilisateur et réessayer svp! ", "Information");
                    LoadingManager.EndLoading(handler);
                }
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(handler);
            }
            finally
            {
            }
        }
        private void RejeterDefacturationLot(List <CsLotri> ListLotSelect)
        {
            int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);

            try
            {
                CsStatFacturation        _laStat = new CsStatFacturation();
                FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));
                service.ValiderRejetDefacturationCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    if (args.Result)
                    {
                        Message.Show(Galatee.Silverlight.Resources.Facturation.Langue.msgRejetDefacturation, Galatee.Silverlight.Resources.Facturation.Langue.LibelleModule);
                    }
                    this.OKButton.IsEnabled = true;
                    LoadingManager.EndLoading(res);
                    this.DialogResult = false;
                };
                service.ValiderRejetDefacturationAsync(ListLotSelect, Action);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
        private void RetourneInfoCanalisation(int fk_idcentre, string centre, string client, string produit, int?point)
        {
            int res1 = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                List <CsCanalisation> CanalisationClientRecherche = new List <CsCanalisation>();
                AcceuilServiceClient  service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.RetourneCanalisationCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    CanalisationClientRecherche = args.Result;
                    RemplireComboBox(CanalisationClientRecherche);
                };
                service.RetourneCanalisationAsync(fk_idcentre, centre, client, produit, point);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                LoadingManager.EndLoading(res1);
            }
        }
Example #8
0
        private void RecuperationListBanque()
        {
            if (SessionObject.ListeBanques == null)
            {
                int loaderHandler       = LoadingManager.BeginLoading(Langue.Data_Loading);
                CaisseServiceClient srv = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                srv.RetourneListeDesBanquesCompleted += (ss, ee) =>
                {
                    try
                    {
                        if (ee.Cancelled || ee.Error != null || ee.Result == null)
                        {
                            string error = ee.Error.InnerException.ToString();
                            return;
                        }

                        //Assignation de la variable de session contenant la liste des banques
                        SessionObject.ListeBanques = ee.Result;
                        if (SessionObject.ListeBanques == null || SessionObject.ListeBanques.Count == 0)
                        {
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Caisse.Langue.errorTitle);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };
                srv.RetourneListeDesBanquesAsync();
            }
        }
        private void RetourneHabilitationUser(List <int> ListidClient)
        {
            string key      = Utility.getKey();
            int    response = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);
            AdministrationServiceClient client = new AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));

            client.RetourneProfilUtilisateurCompleted += (ss, res) =>
            {
                if (res.Cancelled || res.Error != null)
                {
                    string error = res.Error.Message;
                    Message.ShowError(error, Galatee.Silverlight.Resources.Langue.errorTitle);
                    LoadingManager.EndLoading(response);
                    return;
                }
                if (res.Result == null)
                {
                    Message.ShowInformation(Galatee.Silverlight.Resources.Langue.msgNodata, Galatee.Silverlight.Resources.Langue.informationTitle);
                    LoadingManager.EndLoading(response);
                    return;
                }
                LoadingManager.EndLoading(response);
                Utility.ActionDirectOrientation <ServicePrintings.CsHabilitationMenu, ServiceAdministration.CsHabilitationMenu>(res.Result, null, SessionObject.CheminImpression, "ReportHabillitationMenuUser", "Administration", true);
            };
            client.RetourneProfilUtilisateurAsync(lstIUSeru, key);
        }
        private void DefacturationLot(List <CsLotri> ListLotSelect)
        {
            int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours);

            try
            {
                CsStatFacturation        _laStat = new CsStatFacturation();
                FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));
                service.DefacturerLotCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    _laStat = args.Result;
                    if (_laStat != null)
                    {
                        Message.Show("Nombre de client :" + _laStat.NombreCalcule + "\r\n  Montant défacturé : " + decimal.Parse(_laStat.Montant.ToString()).ToString("N2"), "Statistique");
                    }
                    this.OKButton.IsEnabled = true;
                    LoadingManager.EndLoading(res);
                    this.DialogResult = false;
                };
                service.DefacturerLotAsync(ListLotSelect, Action);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
        public List <CsCprofac> GetPrintObjects(string module)
        {
            try
            {
                //this.Parameters = new Dictionary<string, string>();
                //this.Parameters.Add("pCoper", _LibelleCoper);

                int loaderHandler = LoadingManager.BeginLoading("Patienter ... ");


                string mois = (Cmb_month.SelectedIndex <= 0) ? null : Cmb_month.SelectedIndex.ToString("00");
                //string categ = (Cmb_cat.SelectedValue == null) ? null : Cmb_cat.SelectedValue.ToString();
                string categ = (Cmb_cat.SelectedIndex < 0) ? null : categories[Cmb_cat.SelectedIndex].CODE;
                //List<ServiceReport.CsCprofac> listprofac = new List<ServiceReport.CsCprofac>();

                ReportServiceClient service = new ReportServiceClient(Utility.Protocole(), Utility.EndPoint(module));

                List <ServiceReport.CsCprofac> reportPrint = new List <CsCprofac>();

                service.SPX_CPROFAC_SEL_ELEC_CONSOAsync(Txt_year.Text, mois, categ, _Coper);
                service.SPX_CPROFAC_SEL_ELEC_CONSOCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            throw new Exception("Cannot display report");
                        }
                        if (res.Result != null)
                        {
                            //Code en cas de succès
                            reportPrint = res.Result;
                            //Dictionary<string, string> param = new Dictionary<string, string>();
                            Dictionary <string, string> param = null;
                            string key = Utility.getKey();

                            //Effectue l'aperçcu avant imprèssion
                            Utility.ActionPreview <ServicePrintings.CsCprofac, Galatee.Silverlight.ServiceReport.CsCprofac>(reportPrint, param, "CurrentPaymentsDetails", module);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };



                return(reportPrint);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void InitialisationFraude()
        {
            ////Association de campagne à liste de branchement selection
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            int handler = LoadingManager.BeginLoading("Traitement de données ...");

            //service.SaveCampagneElementAsync(listecampageneTosave, new CsREFMETHODEDEDETECTIONCLIENTSBTA(), "");
            service.InitialisationFraudAsync(ListElementLot);
            service.InitialisationFraudCompleted += (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)
                    {
                    }
                    else
                    {
                        Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs",
                                     "Erreur");
                    }

                    LoadingManager.EndLoading(handler);
                }
                catch (Exception)
                {
                    throw;
                }
            };
        }
        private void LoadMethodeDetection()
        {
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            int handler = LoadingManager.BeginLoading("Recuperation des factures ...");

            service.GetMethodeDetectionBTAAsync();
            service.GetMethodeDetectionBTACompleted += (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)
                    {
                        cbxmethrech.ItemsSource       = res.Result;
                        cbxmethrech.DisplayMemberPath = "Libele_Methode";
                        cbxmethrech.SelectedValuePath = "Methode_ID";
                    }
                    else
                    {
                        Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs",
                                     "Erreur");
                    }

                    LoadingManager.EndLoading(handler);
                }
                catch (Exception)
                {
                    throw;
                }
            };
        }
        private void RetourneInfoClient(int fk_idcentre, string Centre, string Client, string Ordre)
        {
            int res1 = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                LeClientRecherche = new CsClient();
                AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.RetourneClientCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    LeClientRecherche = args.Result;
                    if (LeClientRecherche != null)
                    {
                        this.Txt_NomAbon.Text = string.IsNullOrEmpty(LeClientRecherche.NOMABON) ? string.Empty : LeClientRecherche.NOMABON;
                    }
                };
                service.RetourneClientAsync(fk_idcentre, Centre, Client, Ordre);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                LoadingManager.EndLoading(res1);
            }
        }
        private void retourneOrdreMax(string centre, string client, string produit)
        {
            int res1 = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service1.RetourneOrdreMaxCompleted += (se, argss) =>
                {
                    if (argss != null && argss.Cancelled)
                    {
                        return;
                    }
                    OrdreMax = argss.Result;
                    if (OrdreMax != string.Empty)
                    {
                        LaDemande.LaDemande.ORDRE = OrdreMax;
                        RetourneInfoCanalisation(LaDemande.LaDemande.FK_IDCENTRE, LaDemande.LaDemande.CENTRE, LaDemande.LaDemande.CLIENT, LaDemande.LaDemande.PRODUIT, null);
                        RetourneInfoClient(LaDemande.LaDemande.FK_IDCENTRE, LaDemande.LaDemande.CENTRE, LaDemande.LaDemande.CLIENT, LaDemande.LaDemande.ORDRE);
                    }
                };
                service1.RetourneOrdreMaxAsync(centre, client, produit);
                service1.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                LoadingManager.EndLoading(res1);
            }
        }
        private void RemplirFonction()
        {
            try
            {
                ParametrageClient client = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage"));
                int back = LoadingManager.BeginLoading("Chargement des informations de l'étape suivante");
                //Récupération des informations de la demande
                client.GetInfoDemandeWorkflowByListCodeDemandeCompleted += (dsender, dargs) =>
                {
                    if (dargs.Cancelled || dargs.Error != null)
                    {
                        string error = dargs.Error.Message;
                        Message.ShowError(error, Languages.txtDevis);
                    }

                    if (null != dargs.Result)
                    {
                        _OperationID = dargs.Result.First().FK_IDOPERATION;
                        _workflowId  = dargs.Result.First().FK_IDWORKFLOW;
                        _centreID    = dargs.Result.First().FK_IDCENTRE;
                        _idEtape     = dargs.Result.First().FK_IDETAPEACTUELLE;
                        foreach (var item in dargs.Result)
                        {
                            LesCodeDemandeWkf.Add(item.CODE);
                            _NumDemande.Add(item.CODE_DEMANDE_TABLETRAVAIL);
                            _DemandeID.Add(int.Parse(item.FK_IDLIGNETABLETRAVAIL));
                        }

                        client.RecupererInfoEtapeSuivanteByCodeWorkflowCompleted += (ssender, args) =>
                        {
                            LoadingManager.EndLoading(back);
                            if (args.Cancelled || args.Error != null)
                            {
                                string error = args.Error.Message;
                                Message.ShowError(error, Languages.txtDevis);
                            }

                            if (args.Result.key != null && args.Result.value.key != null &&
                                args.Result.value.value != null)
                            {
                                _infoNextStep = new KeyValuePair <CsCopieDmdCircuit, KeyValuePair <CsGroupeValidation,
                                                                                                   List <CsRHabilitationGrouveValidation> > >(args.Result.key,
                                                                                                                                              new KeyValuePair <CsGroupeValidation, List <CsRHabilitationGrouveValidation> >(args.Result.value.key, args.Result.value.value));

                                this.Txt_codeFonction.Text = _infoNextStep.Value.Key.GROUPENAME;
                                this.Txt_codeFonction.Tag  = _infoNextStep.Value.Key.PK_ID;
                            }
                        };
                        client.RecupererInfoEtapeSuivanteByCodeWorkflowAsync(dargs.Result.First().CODE);
                    }
                };
                client.GetInfoDemandeWorkflowByListCodeDemandeAsync(LesCodeDemande);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        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;
            }
        }
Example #18
0
        private void SPX_RPT_SELECT_FACTURES_TOURNEE_DETAIL(List <string> Listcategorie, string TypeEdition, string ValueJour, string ValueMois, string ValueAnnee, Dictionary <string, string> listeParam)
        {
            int loaderHandler           = LoadingManager.BeginLoading("Please Wait for catégorie detail ... ");
            ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Report"));

            //List<ServiceReport.CsFacture> liste = service.SPX_RPT_AREAS_CATEGORY_DETAIL(categorie, TypeEdition, ValueJour, ValueMois, ValueAnnee, null, listeParam);
            List <ServiceReport.CsFacture> liste = new List <CsFacture>();
            string key = Utility.getKey();

            service.SPX_RPT_SELECT_FACTURES_TOURNEE_DETAILAsync(Listcategorie, TypeEdition, ValueJour, ValueMois, ValueAnnee, key, listeParam);
            service.SPX_RPT_SELECT_FACTURES_TOURNEE_DETAILCompleted += (er, res) =>
            {
                try
                {
                    if (res.Error != null || res.Cancelled)
                    {
                        LoadingManager.EndLoading(loaderHandler);
                        Message.ShowInformation("Erreur survenue lors de l'appel service", "ERROR");
                        return;
                    }
                    if (res.Result == null)
                    {
                        LoadingManager.EndLoading(loaderHandler);
                        Message.ShowInformation("Impossible d'afficher le rapport", "ERROR");
                        return;
                    }

                    liste = res.Result;

                    List <ServiceReport.CsFacture> reportPrint = new List <CsFacture>();

                    if (this.ddbSolde.SelectedValue != null && this.ddbSolde.SelectedValue.ToString() != string.Empty &&
                        this.txtMarge.Text != string.Empty)
                    {
                        reportPrint = ConstruireNouvelleListe(liste);
                    }
                    else
                    {
                        reportPrint.AddRange(liste);
                    }

                    listefinale.AddRange(reportPrint);
                    this.DefinedRDLC = reportName;

                    Utility.ActionPreview <ServicePrintings.CsFacture, ServiceReport.CsFacture>(listefinale, listeParam, this.DefinedRDLC, "Report");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    LoadingManager.EndLoading(loaderHandler);
                }
            };
        }
        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;
            }
        }
Example #20
0
        public List <ServiceReport.CsConnexion> GetPrintObjects(string module)
        {
            try
            {
                //if (Txt_Year.Text.Length != 4)
                //{
                //    return null;
                //}
                //else
                //{
                //IdProd =int.Parse(Cmb_Produit.SelectedValue.ToString());
                ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint(module));
                //string mois = (Cmb_month.SelectedIndex < 0) ? null : (Cmb_month.SelectedIndex + 1).ToString("00");
                List <ServiceReport.CsConnexion> reportPrint = new List <CsConnexion>();

                int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... ");
                service.GetNewBranchementsByProduitAsync(Txt_Year.Text, IdProd, Etat);
                service.GetNewBranchementsByProduitCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            throw new Exception("Cannot display report");
                        }
                        if (res.Result != null)
                        {
                            reportPrint = res.Result.OrderBy(c => c.Mois).ToList();

                            Dictionary <string, string> dico = new Dictionary <string, string>();
                            dico.Add("annee", Txt_Year.Text);
                            //Effectue l'aperçcu avant imprèssion
                            //Utility.ActionPreview<ServicePrintings.CsConnexion, Galatee.Silverlight.ServiceReport.CsConnexion>(reportPrint, dico, DefinedRDLC, module);
                            Utility.ActionDirectOrientation <ServicePrintings.CsConnexion, Galatee.Silverlight.ServiceReport.CsConnexion>(reportPrint, dico, SessionObject.DefaultPrinter, "VisuReportNewElectricityServiceConnection", module, false);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };

                //this.DefinedRDLC = "ConnexionsElectricite";
                return(reportPrint);
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #21
0
        private void RetourneDetailDemande(CsDemandeBase laDemandeSelect)
        {
            int res = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                CsDemande            leDetailDemande = new CsDemande();
                AcceuilServiceClient service         = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.RetourneDetailDemandeCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    leDetailDemande = args.Result;
                    LoadingManager.EndLoading(res);

                    if (laDemandeSelect.LIBELLESTATUT == Langue.lib_Statut_EnAttente ||
                        laDemandeSelect.LIBELLESTATUT == Langue.lib_Statut_Rejeter)
                    {
                        if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationAbonnement)
                        {
                            //FrmValidationModificationAbonnement frm = new FrmValidationModificationAbonnement(leDetailDemande, true );
                            //frm.Show();
                        }
                        if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationAdresse)
                        {
                            //FrmValidationModificationAdresse frm = new FrmValidationModificationAdresse(leDetailDemande, true);
                            //frm.Show();
                        }
                        if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationBranchement)
                        {
                            //FrmValidationModificationBranchement frm = new FrmValidationModificationBranchement(leDetailDemande,true );
                            //frm.Show();
                        }
                        if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationCompteur)
                        {
                            //FrmValidationModificationCompteur frm = new FrmValidationModificationCompteur(leDetailDemande,true );
                            //frm.Show();
                        }
                        if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationClient)
                        {
                            //FrmValidationModificationClient frm = new FrmValidationModificationClient(leDetailDemande,true );
                            //frm.Show();
                        }
                    }
                };
                service.RetourneDetailDemandeAsync(laDemandeSelect);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
        public void GetPrintObjects(string module)
        {
            try
            {
                this.Parameters = new Dictionary <string, string>();
                this.Parameters.Add("pCoper", _LibelleCoper);

                int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... ");
                //List<CsSales> reportPrint=new List<CsSales>();
                List <ServiceReport.CsCprofac> listprofac = new List <ServiceReport.CsCprofac>();

                ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint((module)));
                string key = Utility.getKey();
                service.QUANTITY_SOLD_BY_CATEGAsync(Txt_year.Text, _Coper, key, this.Parameters);
                service.QUANTITY_SOLD_BY_CATEGCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            Message.ShowInformation("Erreur survenue lors de l'appel service", "ERROR");
                            return;
                        }
                        if (res.Result == null)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            Message.ShowInformation("Impossible d'afficher le rapport", "ERROR");
                            return;
                        }
                        ////Code en cas de succès
                        //reportPrint = res.Result;
                        //Dictionary<string, string> param = new Dictionary<string, string>();
                        //Dictionary<string, string> param = null;
                        //string key = Utility.getKey();

                        ////Effectue l'aperçcu avant imprèssion
                        Utility.ActionPreview <ServicePrintings.CsSales>(null, "QuantitySoldByCategory", module, key);
                        //Utility.ActionPreview<ServicePrintings.CsSales, Galatee.Silverlight.ServiceReport.CsSales>(reportPrint, param, "QuantitySoldByCategory", module);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void LoadAllRedevance()
        {
            try
            {
                if (SessionObject.ListeRedevence.Count != 0)
                {
                    ListeRedevence = SessionObject.ListeRedevence;

                    return;
                }
                TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification"));
                int handler = LoadingManager.BeginLoading("Chargement des donnée ...");
                service.LoadAllRedevanceAsync();
                service.LoadAllRedevanceCompleted += (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.ListeRedevence = res.Result;
                            foreach (var item in SessionObject.ListeRedevence)
                            {
                                ListeRedevence.Add(item);
                            }
                            SessionObject.ListeRedevence = ListeRedevence;
                            InitCentre_Redev_RechTarif_ModeCalc_ModeApp();
                            //System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(ListeRedevence);
                            //dgListeRedevence.ItemsSource = view;
                            //datapager.Source = view;
                        }
                        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;
            }
        }
Example #24
0
        public void FillSecteurs()
        {
            try
            {
                ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Report"));
                //categories = service.SELECT_ALL_CATEGORY_By_NUMTABLE(12); // 12 represente la category
                //ddbSecteur.Items.Clear();
                //foreach (CsTa item in categories)
                //{
                //    string cat = item.PK_CODE.Substring(4, 2);
                //    item.PK_CODE = cat;
                //    ddbSecteur.Items.Add(cat);
                //}

                int    loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... ");
                string key           = Utility.getKey();
                service.SELECT_ALL_TOURNEEAsync();
                service.SELECT_ALL_TOURNEECompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            throw new Exception("Cannot display report");
                        }
                        if (res.Result != null)
                        {
                            //Code en cas de succès
                            foreach (var item in res.Result)
                            {
                                categories.Add(item);
                            }

                            Cmb_categ.ItemsSource = categories;
                            //Cmb_categ.DisplayMemberPath = "LIBELLE";
                            //Cmb_categ.SelectedValuePath = "NUM";
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };
            }
            catch (Exception ex)
            {
                //throw;
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
Example #25
0
        private void RetourneDemande(string centre, string numdem, string LstTdem, string produit, DateTime?datedebut)
        {
            int res = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                List <CsDemandeBase> _listDemande = new List <CsDemandeBase>();
                AcceuilServiceClient service      = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.RetourneListeDemandeModificationPourSuvieCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    _listDemande = args.Result;
                    if (_listDemande != null && _listDemande.Count != 0)
                    {
                        foreach (CsDemandeBase item in _listDemande)
                        {
                            item.LIBELLE       = SessionObject.LstTypeDemande.FirstOrDefault(p => p.CODE == item.TYPEDEMANDE).LIBELLE;
                            item.LIBELLESTATUT = RetourneLibelleStatutDemande(item);
                        }


                        List <Galatee.Silverlight.ServiceAccueil.CsCentre> lstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser);
                        List <Galatee.Silverlight.ServiceAccueil.CsSite>   lstSite   = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre);

                        List <int> lstCentreHabil = new List <int>();
                        foreach (var item in lstCentre)
                        {
                            lstCentreHabil.Add(item.PK_ID);
                        }
                        List <CsDemandeBase> _lstDemande = _listDemande.Where(t => lstCentreHabil.Contains(t.FK_IDCENTRE)).ToList();
                        this.dtg_Demande.ItemsSource = null;
                        this.dtg_Demande.ItemsSource = _lstDemande;
                        datapager.Source             = _lstDemande;



                        //this.dtg_Demande.ItemsSource = null;
                        //this.dtg_Demande.ItemsSource = _listDemande;
                        //datapager.Source = _listDemande;
                    }
                    LoadingManager.EndLoading(res);
                };
                service.RetourneListeDemandeModificationPourSuvieAsync(centre, numdem, LstTdem, produit, datedebut, UserConnecte.matricule);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
 public void LoadAllVariableTarif()
 {
     try
     {
         if (SessionObject.ListeRechercheTarif.Count > 0)
         {
             foreach (var item in SessionObject.ListeVariableTarif)
             {
                 ListeVariableTarif.Add(item);
             }
             LoadDatagrid();
         }
         else
         {
             TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification"));
             int handler = LoadingManager.BeginLoading("Chargement des donnée ...");
             service.LoadAllVariableTarifAsync();
             service.LoadAllVariableTarifCompleted += (er, res) =>
             {
                 try
                 {
                     if (res.Error != null || res.Cancelled)
                     {
                         Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur");
                     }
                     else
                     if (res.Result != null)
                     {
                         SessionObject.ListeVariableTarif = res.Result;
                         foreach (var item in res.Result)
                         {
                             ListeVariableTarif.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;
     }
 }
        public void Save(List <CsTypeCompte> TypeCompteRecuToUpdate, List <CsTypeCompte> TypeCompteRecuToInserte, List <CsTypeCompte> TypeCompteRecuToDelete)
        {
            try
            {
                InterfaceComptableServiceClient service = new InterfaceComptableServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("InterfaceComptable"));
                int handler = LoadingManager.BeginLoading("Mise à jour des données ...");
                service.SaveTypeCompteAsync(TypeCompteRecuToUpdate, TypeCompteRecuToInserte, TypeCompteRecuToDelete);
                service.SaveTypeCompteCompleted += (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)
                        {
                            if (res.Result > 0)
                            {
                                CsTypeCompte TypeCompte = ListeTypeCompte.FirstOrDefault(l => l.PK_ID == 0);
                                if (TypeCompte != null)
                                {
                                    int index = ListeTypeCompte.IndexOf(TypeCompte);
                                    TypeCompte.PK_ID       = res.Result;
                                    ListeTypeCompte[index] = TypeCompte;
                                }

                                LoadDatagrid();
                            }
                            else
                            {
                                Message.Show("Sauvegarde non effectué avec succes,il se peut vos modification n'est pas été pris en conte",
                                             "Info");
                            }
                        }
                        else
                        {
                            Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs",
                                         "Erreur");
                        }
                        LoadingManager.EndLoading(handler);
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #28
0
        private void GetData()
        {
            int back = 0;

            try
            {
                back = LoadingManager.BeginLoading("Chargement des données en cours...");
                ParametrageClient client = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage"));
                client.GetAllCasindCompleted += (ssender, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            LoadingManager.EndLoading(back);
                            Message.ShowError(error, Languages.CasDeReleve);
                            return;
                        }
                        if (args.Result == null)
                        {
                            LoadingManager.EndLoading(back);
                            Message.ShowError(Languages.msgErreurChargementDonnees, Languages.CasDeReleve);
                            return;
                        }
                        DonnesDatagrid.Clear();
                        if (args.Result != null)
                        {
                            foreach (var item in args.Result)
                            {
                                item.SAISIEINDEX    = RetournerLibelleElementSaisie(item.SAISIEINDEX);
                                item.SAISIECOMPTEUR = RetournerLibelleElementSaisie(item.SAISIECOMPTEUR);
                                item.SAISIECONSO    = RetournerLibelleElementSaisie(item.SAISIECONSO);
                                DonnesDatagrid.Add(item);
                            }
                        }
                        dtgrdParametre.ItemsSource = DonnesDatagrid;
                        LoadingManager.EndLoading(back);
                    }
                    catch (Exception ex)
                    {
                        LoadingManager.EndLoading(back);
                        Message.ShowError(ex.Message, Languages.CasDeReleve);
                    }
                };
                client.GetAllCasindAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(back);
                throw ex;
            }
        }
Example #29
0
 public void Save(List <CsRechercheTarif> RechercheTarifoUpdate, List <CsRechercheTarif> RechercheTarifoInserte, List <CsRechercheTarif> RechercheTarifoDelete)
 {
     try
     {
         TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification"));
         int handler = LoadingManager.BeginLoading("Mise à jour des données ...");
         service.SaveRechercheTarifAsync(RechercheTarifoUpdate, RechercheTarifoInserte, RechercheTarifoDelete);
         service.SaveRechercheTarifCompleted += (er, res) =>
         {
             try
             {
                 if (res.Error != null || res.Cancelled)
                 {
                     Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur");
                 }
                 else
                 if (res.Result != null)
                 {
                     if (res.Result > 0)
                     {
                         CsRechercheTarif RechercheTarif = ListeRechercheTarif.FirstOrDefault(l => l.PK_ID == 0);
                         if (RechercheTarif != null)
                         {
                             int index = ListeRechercheTarif.IndexOf(RechercheTarif);
                             RechercheTarif.PK_ID       = res.Result;
                             ListeRechercheTarif[index] = RechercheTarif;
                         }
                         LoadDatagraid();
                     }
                     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 consultez le journal des erreurs",
                                  "Erreur");
                 }
                 LoadingManager.EndLoading(handler);
             }
             catch (Exception)
             {
                 throw;
             }
         };
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void LoadTarifGenerer(CsVariableDeTarification lavariable)
 {
     try
     {
         //string FK_IDRECHERCHETARIF=string.Empty;
         //string PK_ID=string.Empty;
         //if (cbo_variable_tarification.SelectedItem!=null)
         //{
         //    FK_IDRECHERCHETARIF= ((CsVariableDeTarification)cbo_variable_tarification.SelectedItem).FK_IDRECHERCHETARIF.ToString();
         //    PK_ID=((CsVariableDeTarification)cbo_variable_tarification.SelectedItem).PK_ID.ToString();
         //}
         TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification"));
         int handler = LoadingManager.BeginLoading("Chargement des donnée ...");
         service.LoadTarifGenererAsync(lavariable.FK_IDRECHERCHETARIF.ToString(), lavariable.PK_ID.ToString(), lavariable.PRODUIT);
         service.LoadTarifGenererCompleted += (er, res) =>
         {
             try
             {
                 if (res.Error != null || res.Cancelled)
                 {
                     Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur");
                 }
                 else
                 if (res.Result != null)
                 {
                     //Code de chargement de la grid pr les ligne de redevence
                     foreach (var item in res.Result)
                     {
                         ListeTarifFacturation.Add(item);
                     }
                     //TarifFacturationoInserte = res.Result;
                     LoadDatagrid(ListeTarifFacturation.OrderBy(t => t.CTARCOMP).ToList());
                 }
                 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;
     }
 }