private void ChargeDetailDEvis(CsClient leclient)
 {
     Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
     client.GeDetailByFromClientCompleted += (ssender, args) =>
     {
         if (args.Cancelled || args.Error != null)
         {
             LayoutRoot.Cursor = Cursors.Arrow;
             string error = args.Error.Message;
             Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
             return;
         }
         if (args.Result == null)
         {
             LayoutRoot.Cursor = Cursors.Arrow;
             Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
             return;
         }
         else
         {
             //laDetailDemande_temp = args.Result;
             desableProgressBar();
         }
         LayoutRoot.Cursor = Cursors.Arrow;
     };
     client.GeDetailByFromClientAsync(leclient);
 }
 private void RetourneOrdre(CsClient leClient)
 {
     try
     {
         string OrdreMax = string.Empty;
         AcceuilServiceClient service = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
         service.RetourneOrdreMaxCompleted += (s, args) =>
         {
             if (args != null && args.Cancelled)
             {
                 return;
             }
             OrdreMax = args.Result;
             if (OrdreMax != null)
             {
                 leClient.ORDRE = OrdreMax;
                 ChargeDetailDEvis(leClient);
             }
         };
         service.RetourneOrdreMaxAsync(leClient.FK_IDCENTRE.Value, leClient.CENTRE, leClient.REFCLIENT, leClient.PRODUIT);
         service.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void ChargeDetailDEvis(int IdDemandeDevis)
        {
            AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));

            client.ChargerDetailDemandeCompleted += (ssender, args) =>
            {
                prgBar.Visibility = System.Windows.Visibility.Collapsed;
                if (args.Cancelled || args.Error != null)
                {
                    string error = args.Error.Message;
                    Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                else
                {
                    laDetailDemande = args.Result;
                    ServiceAccueil.CsClient leCleint = new CsClient()
                    {
                        CENTRE      = laDetailDemande.LaDemande.CENTRE,
                        REFCLIENT   = laDetailDemande.LaDemande.CLIENT,
                        ORDRE       = laDetailDemande.LaDemande.ORDRE,
                        FK_IDCENTRE = laDetailDemande.LaDemande.FK_IDCENTRE,
                        TYPEDEMANDE = laDetailDemande.LaDemande.TYPEDEMANDE
                    };
                    RetourneInfoAdresseduClient(leCleint);
                }
            };
            client.ChargerDetailDemandeAsync(IdDemandeDevis, string.Empty);
        }
 private void RemplireOngletClient(CsClient _LeClient)
 {
     try
     {
         if (_LeClient != null)
         {
             this.Txt_NomClient.Text = (string.IsNullOrEmpty(_LeClient.NOMABON) ? string.Empty : _LeClient.NOMABON);
             //this.Txt_Telephone1.Text = string.IsNullOrEmpty(_LeClient.TELEPHONE) ? string.Empty : _LeClient.TELEPHONE;
             //this.tab12_txt_addresse.Text = string.IsNullOrEmpty(_LeClient.ADRMAND1) ? string.Empty : _LeClient.ADRMAND1;
             //this.tab12_txt_addresse2.Text = string.IsNullOrEmpty(_LeClient.ADRMAND2) ? string.Empty : _LeClient.ADRMAND2;
             //this.txt_NINA.Text = string.IsNullOrEmpty(_LeClient.NUMEROIDCLIENT) ? string.Empty : _LeClient.NUMEROIDCLIENT;
             this.tab12_Txt_LibelleCodeConso.Text  = string.IsNullOrEmpty(_LeClient.LIBELLECODECONSO) ? string.Empty : _LeClient.LIBELLECODECONSO;
             this.tab12_Txt_LibelleCategorie.Text  = string.IsNullOrEmpty(_LeClient.LIBELLECATEGORIE) ? string.Empty : _LeClient.LIBELLECATEGORIE;
             this.tab12_Txt_LibelleEtatClient.Text = string.IsNullOrEmpty(_LeClient.LIBELLERELANCE) ? string.Empty : _LeClient.LIBELLERELANCE;
             this.tab12_Txt_LibelleTypeClient.Text = string.IsNullOrEmpty(_LeClient.LIBELLENATURECLIENT) ? string.Empty : _LeClient.LIBELLENATURECLIENT;
             this.tab12_Txt_Nationnalite.Text      = string.IsNullOrEmpty(_LeClient.LIBELLENATIONALITE) ? string.Empty : _LeClient.LIBELLENATIONALITE;
             this.tab12_Txt_Datecreate.Text        = string.IsNullOrEmpty(_LeClient.DATECREATION.ToString()) ? string.Empty : Convert.ToDateTime(_LeClient.DATECREATION).ToShortDateString();
             //this.tab12_Txt_DateModif.Text = string.IsNullOrEmpty(_LeClient.DATEMODIFICATION.ToString()) ? string.Empty : Convert.ToDateTime(_LeClient.DATEMODIFICATION).ToShortDateString();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
 private void VerifieExisteDemande(CsClient leClient)
 {
     try
     {
         if (!string.IsNullOrEmpty(Txt_ReferenceClient.Text) && Txt_ReferenceClient.Text.Length == SessionObject.Enumere.TailleClient)
         {
             string OrdreMax = string.Empty;
             AcceuilServiceClient service = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
             service.RetourneDemandeClientTypeCompleted += (s, args) =>
             {
                 if (args != null && args.Cancelled)
                 {
                     return;
                 }
                 if (args.Result != null)
                 {
                     if (args.Result.DATEFIN == null && args.Result.ISSUPPRIME != true)
                     {
                         Message.ShowInformation("Il existe une demande numero " + args.Result.NUMDEM + " sur ce client", "Accueil");
                         prgBar.Visibility = System.Windows.Visibility.Collapsed;
                         return;
                     }
                 }
                 ChargeDetailDEvis(leClient);
             };
             service.RetourneDemandeClientTypeAsync(leClient);
             service.CloseAsync();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void RetourneInfoClient(CsClient leClientRech)
        {
            AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            service.RetourneAbonCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowError(Langue.Msg_AbonnemtInexistant, Galatee.Silverlight.Resources.Facturation.Langue.LibelleModule);
                    return;
                }
                if (args.Result != null && args.Result.Count == 1)
                {
                    leAbonnement = args.Result.First();
                }

                if (leAbonnement != null && !string.IsNullOrEmpty(leAbonnement.CENTRE))
                {
                    RetourneEvenementCanalisation(leAbonnement, this.txtPeriode.Text);
                }
            };
            service.RetourneAbonAsync(leClientRech.FK_IDCENTRE.Value, leClientRech.CENTRE, leClientRech.REFCLIENT, leClientRech.ORDRE);
            service.CloseAsync();
        }
Пример #7
0
 private void ValiderRendezVous(CsClient leClient, DateTime laDateRendezVous)
 {
     try
     {
         Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient client = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
         client.SaveRDVCoupureHorsCampagneAsync(leClient, laDateRendezVous);
         client.SaveRDVCoupureHorsCampagneCompleted += (ss, args) =>
         {
             try
             {
                 if (args.Cancelled || args.Error != null)
                 {
                     string error = args.Error.Message;
                     Message.ShowError("Error à l'appel du service", "SearchCampagne");
                     return;
                 }
                 if (args.Result == true)
                 {
                     Message.ShowInformation("Mise a jour validée", "Rendez-vous");
                     this.DialogResult = false;
                     return;
                 }
                 this.DialogResult = false;
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
             }
         };
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
Пример #8
0
        private void ChargeDetailDEvis(int IdDemandeDevis)
        {
            AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));

            client.GetDevisByNumIdDevisCompleted += (ssender, args) =>
            {
                if (args.Cancelled || args.Error != null)
                {
                    string error = args.Error.Message;
                    Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                else
                {
                    laDetailDemande     = args.Result;
                    this.Txt_Motif.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.MOTIF) ? string.Empty  : laDetailDemande.LaDemande.MOTIF;
                    ServiceAccueil.CsClient leCleint = new CsClient()
                    {
                        CENTRE      = laDetailDemande.LaDemande.CENTRE,
                        REFCLIENT   = laDetailDemande.LaDemande.CLIENT,
                        ORDRE       = laDetailDemande.LaDemande.ORDRE,
                        FK_IDCENTRE = laDetailDemande.LaDemande.FK_IDCENTRE,
                        TYPEDEMANDE = laDetailDemande.LaDemande.TYPEDEMANDE
                    };
                    RetourneInfoAdresseduClient(leCleint);
                }
                LayoutRoot.Cursor = Cursors.Arrow;
            };
            client.GetDevisByNumIdDevisAsync(IdDemandeDevis);
        }
        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 RetourneInfoClient(int fk_idcentre, string centre, string client, string ordre)
        {
            CsClient             ClientRecherche = new CsClient();
            AcceuilServiceClient service         = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            service.RetourneClientCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result != null)
                {
                    ClientRecherche = args.Result;
                    TabItem tabItem1 = new TabItem();
                    tabItem1.Header = "ANCIENNES DONNEES";
                    _LectrlClient   = new UcDemandeDetailClient(ClientRecherche, laDemande.LaDemande.TYPEDEMANDE);

                    tabItem1.Content = _LectrlClient;
                    tabControl1.Items.Add(tabItem1);
                    tabControl1.SelectedItem = tabItem1;

                    laDemande.LeClient.PK_ID = ClientRecherche.PK_ID;

                    TabItem tabItem2 = new TabItem();
                    tabItem2.Header  = "NOUVELLES DONNEES";
                    _LectrlClient    = new UcDemandeDetailClient(laDemande, true);
                    tabItem2.Content = _LectrlClient;
                    tabControl1.Items.Add(tabItem2);
                    tabControl1.SelectedItem = tabItem2;
                }
            };
            service.RetourneClientAsync(fk_idcentre, centre, client, ordre);
            service.CloseAsync();
        }
Пример #11
0
 private void btnsearch_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(this.txtCentreClient.Text) &&
             !string.IsNullOrEmpty(txtReferenceClient.Text) &&
             !string.IsNullOrEmpty(txtOrdeClient.Text))
         {
             ClientRechercheSelect             = new CsClient();
             ClientRechercheSelect.FK_IDCENTRE = (int)this.txtCentre.Tag;
             ClientRechercheSelect.CENTRE      = txtCentreClient.Text;
             ClientRechercheSelect.REFCLIENT   = txtReferenceClient.Text;
             Recherche(CampagneSelect, ClientRechercheSelect);
         }
         this.lvwResultat.ItemsSource = null;
         if (CampagneSelect != null && !string.IsNullOrEmpty(CampagneSelect.IDCOUPURE))
         {
             Recherche(CampagneSelect, ClientRechercheSelect);
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
        private void RetourneEvenement(CsClient leClient)
        {
            try
            {
                FacturationServiceClient ClientSrv = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));
                ClientSrv.RetourneEvenementCorrectionIndexCompleted += (e, argsss) =>
                {
                    if (argsss != null && argsss.Cancelled)
                    {
                        return;
                    }
                    List <CsEvenement> Res = argsss.Result;

                    this.Cbo_Compteur.ItemsSource       = null;
                    this.Cbo_Compteur.ItemsSource       = Res;
                    this.Cbo_Compteur.DisplayMemberPath = "COMPTEUR";
                    if (Res.Count == 1)
                    {
                        this.Cbo_Compteur.SelectedItem = Res.First();
                    }
                };
                ClientSrv.RetourneEvenementCorrectionIndexAsync(leClient);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void RetourneInfoClient(CsClient leClientRech)
        {
            FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));

            service.RetourneAbonCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowError(Langue.Msg_AbonnemtInexistant, Galatee.Silverlight.Resources.Facturation.Langue.LibelleModule);
                    return;
                }
                if (args.Result != null && args.Result.Count == 1)
                {
                    leAbonnement = args.Result.First();
                }
                this.Txt_NomAbon.Text     = leAbonnement.NOMABON;
                leClientRech.FK_IDABON    = leAbonnement.PK_ID;
                leClientRech.FK_IDPRODUIT = leAbonnement.FK_IDPRODUIT;
                leClientRech.FK_IDCENTRE  = leAbonnement.FK_IDCENTRE;
                leClientRech.PERIODE      = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(this.Txt_PeriodeEnCour.Text);
                if (leAbonnement != null && !string.IsNullOrEmpty(leAbonnement.CENTRE))
                {
                    RetourneEvenement(leClientRech);
                }
            };
            service.RetourneAbonAsync(leClientRech.FK_IDCENTRE.Value, leClientRech.CENTRE, leClientRech.REFCLIENT, leClientRech.ORDRE);
            service.CloseAsync();
        }
Пример #14
0
 private void RetourneInfoCompteur(CsClient leClient)
 {
     try
     {
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
         client.ChargerDetailClientCompleted += (ss, args) =>
         {
             if (args.Cancelled || args.Error != null)
             {
                 LayoutRoot.Cursor = Cursors.Arrow;
                 string error = args.Error.Message;
                 Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                 return;
             }
             if (args.Result == null)
             {
                 LayoutRoot.Cursor = Cursors.Arrow;
                 Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                 return;
             }
             LayoutRoot.Cursor = Cursors.Arrow;
         };
         client.ChargerDetailClientAsync(leClient);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #15
0
 private void ChargerClientFromReference(string ReferenceClient)
 {
     try
     {
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.RetourneClientByReferenceCompleted += (s, args) =>
         {
             if ((args != null && args.Cancelled) || (args.Error != null))
             {
                 return;
             }
             if (args.Result != null && args.Result.Count > 1)
             {
                 List <object> _Listgen = ClasseMEthodeGenerique.RetourneListeObjet(args.Result);
                 Galatee.Silverlight.MainView.UcListeGenerique ctr = new Galatee.Silverlight.MainView.UcListeGenerique(_Listgen, "CENTRE", "LIBELLESITE", "Liste des site");
                 ctr.Show();
                 ctr.Closed += new EventHandler(galatee_OkClickedChoixClient);
             }
             else
             {
                 CsClient leClient = args.Result.First();
                 leClient.TYPEDEMANDE = Tdem;
                 VerifieExisteDemande(leClient);
             }
         };
         service.RetourneClientByReferenceAsync(ReferenceClient, lstIdCentre);
         service.CloseAsync();
     }
     catch (Exception)
     {
         prgBar.Visibility = System.Windows.Visibility.Collapsed;
         Message.ShowError("Erreur au chargement des données", "Demande");
     }
 }
        private void ChargerCompteDeResiliation(CsClient _UnClient)
        {
            AcceuilServiceClient client = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            client.ChargerCompteDeResiliationCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null || args.Result.Count == 0)
                {
                    return;
                }
                List <CsLclient> lstFactureDuClient = args.Result;
                lstFactureDuClient.ForEach(t => t.REFEM = (!string.IsNullOrEmpty(t.REFEM)? ClasseMEthodeGenerique.FormatPeriodeMMAAAA(t.REFEM):string.Empty));
                if (lstFactureDuClient != null && lstFactureDuClient.Count != 0)
                {
                    AfficherOuMasquer(tabItemCompteClient, true);
                    dtg_CompteClient.ItemsSource = null;
                    dtg_CompteClient.ItemsSource = lstFactureDuClient;
                    lstFactureDuClient.ForEach(i => i.MONTANTPAYPARTIEL = ((i.MONTANT == null ? 0 : i.MONTANT) - (i.SOLDEFACTURE == null ? 0 : i.SOLDEFACTURE)));
                    Txt_TotalSoldeResil.Text = lstFactureDuClient.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
                }
            };
            client.ChargerCompteDeResiliationAsync(_UnClient);
            client.CloseAsync();
        }
        private void ChargeDetailDEvis(int IdDemandeDevis)
        {
            AcceuilServiceClient client = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            client.ChargerDetailDemandeCompleted += (ssender, args) =>
            {
                if (args.Cancelled || args.Error != null)
                {
                    string error = args.Error.Message;
                    Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                    return;
                }
                else
                {
                    laDetailDemande = args.Result;
                    ServiceAccueil.CsClient leCleint = new CsClient()
                    {
                        CENTRE      = laDetailDemande.LaDemande.CENTRE,
                        REFCLIENT   = laDetailDemande.LaDemande.CLIENT,
                        ORDRE       = laDetailDemande.LaDemande.ORDRE,
                        FK_IDCENTRE = laDetailDemande.LaDemande.FK_IDCENTRE,
                        TYPEDEMANDE = laDetailDemande.LaDemande.TYPEDEMANDE
                    };
                    RetourneAbonClient(leCleint);
                }
                LayoutRoot.Cursor = Cursors.Arrow;
            };
            client.ChargerDetailDemandeAsync(IdDemandeDevis, string.Empty);
        }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     if (this.Cbo_ListeSite.SelectedItem != null)
     {
         leSiteSelectionner = (CsClient)this.Cbo_ListeSite.SelectedItem;
     }
     this.DialogResult = true;
 }
 private void galatee_OkClickedChoixClient(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         CsClient _UnClient = (CsClient)ctrs.MyObject;
         ChargeDetailDEvis(_UnClient);
     }
 }
Пример #20
0
 private void galatee_OkClickedChoixClient(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         CsClient _UnClient = (CsClient)ctrs.MyObject;
         _UnClient.TYPEDEMANDE = Tdem;
         VerifieExisteDemande(_UnClient);
     }
 }
        private void ChargeDetailDEvis(int IdDemandeDevis)
        {
            ServiceAccueil.AcceuilServiceClient client = new ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
            client.ChargerDetailDemandeCompleted += (ssender, args) =>
            {
                if (args.Cancelled || args.Error != null)
                {
                    LayoutRoot.Cursor = Cursors.Arrow;
                    string error = args.Error.Message;
                    Message.ShowError(error, this.Title.ToString());
                    return;
                }
                if (args.Result == null)
                {
                    LayoutRoot.Cursor = Cursors.Arrow;
                    Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, this.Title.ToString());
                    return;
                }
                else
                {
                    laDetailDemande             = new ServiceAccueil.CsDemande();
                    laDetailDemande             = args.Result;
                    this.Txt_CodeSite.Text      = laDetailDemande.LaDemande.NUMDEM.Substring(3, 3);
                    this.Txt_CodeCentre.Text    = laDetailDemande.LaDemande.CENTRE;
                    this.txtClient.Text         = laDetailDemande.LaDemande.CLIENT;
                    this.txtOrdre.Text          = laDetailDemande.LaDemande.ORDRE;
                    this.Txt_NomAbon.Text       = laDetailDemande.LeClient.NOMABON;
                    this.Txt_Produit.Text       = laDetailDemande.LaDemande.LIBELLEPRODUIT;
                    this.Txt_PeriodeEnCour.Text = Shared.ClasseMEthodeGenerique.FormatPeriodeMMAAAA(laDetailDemande.LstEvenement.First().PERIODE);

                    if (this.Cbo_Compteur.ItemsSource != null)
                    {
                        this.Cbo_Compteur.SelectedItem = ((List <CsEvenement>) this.Cbo_Compteur.ItemsSource).First(a => a.FK_IDCOMPTEUR == laDetailDemande.LstEvenement.First().FK_IDCOMPTEUR);
                    }
                    this.txtDemande.Text      = laDetailDemande.LaDemande.NUMDEM;
                    this.txtMotifDemande.Text = laDetailDemande.LaDemande.MOTIF;
                    this.txtMotifRejet.Text   = laDetailDemande.AnnotationDemande.First().COMMENTAIRE;
                    this.Txt_AncIndex.Text    = laDetailDemande.LstEvenement.First().INDEXEVTPRECEDENT.ToString();
                    this.Txt_NouvIndex.Text   = laDetailDemande.LstEvenement.First().INDEXEVT.ToString();

                    CsClient rech = new CsClient();

                    rech.FK_IDABON    = laDetailDemande.LstEvenement.First().FK_IDABON;
                    rech.FK_IDPRODUIT = laDetailDemande.LstEvenement.First().FK_IDPRODUIT;
                    rech.FK_IDCENTRE  = laDetailDemande.LstEvenement.First().FK_IDCENTRE;
                    rech.CENTRE       = laDetailDemande.LstEvenement.First().CENTRE;
                    rech.REFCLIENT    = laDetailDemande.LstEvenement.First().CLIENT;
                    rech.ORDRE        = laDetailDemande.LstEvenement.First().ORDRE;
                    rech.PRODUIT      = laDetailDemande.LstEvenement.First().PRODUIT;
                    rech.PERIODE      = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(this.Txt_PeriodeEnCour.Text);
                    RetourneEvenement(rech);
                }
            };
            client.ChargerDetailDemandeAsync(IdDemandeDevis, string.Empty);
        }
Пример #22
0
        private void ChargeDetailDEvis(CsClient leclient)
        {
            try
            {
                prgBar.Visibility = System.Windows.Visibility.Visible;

                leclient.TYPEDEMANDE = Tdem;
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                client.ChargerDetailClientAsync(leclient);
                client.ChargerDetailClientCompleted += (ssender, args) =>
                {
                    prgBar.Visibility = System.Windows.Visibility.Collapsed;

                    if (args.Cancelled || args.Error != null)
                    {
                        string error = args.Error.Message;
                        Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    if (args.Result == null)
                    {
                        Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    else
                    {
                        laDetailDemande = new CsDemande();
                        laDetailDemande = args.Result;
                        if (laDetailDemande.Abonne != null && laDetailDemande.Abonne.DRES == null)
                        {
                            this.txtSite.Text   = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLESITE) ? string.Empty : laDetailDemande.LeClient.LIBELLESITE;
                            this.txtCentre.Text = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLECENTRE) ? string.Empty : laDetailDemande.LeClient.LIBELLECENTRE;
                            this.txtCentre.Tag  = laDetailDemande.Abonne.FK_IDCENTRE;
                            this.txt_tdem.Text  = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).LIBELLE;
                            txt_tdem.Tag        = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem);
                            AfficherInfoAdresse(laDetailDemande.Ag);
                            AfficherDocumentScanne(laDetailDemande.ObjetScanne);
                        }
                        else
                        {
                            Message.ShowInformation("Ce abonné est résilié", "Info");
                            return;
                        }
                    }
                };
            }
            catch (Exception ex)
            {
                prgBar.Visibility = System.Windows.Visibility.Collapsed;
                Message.ShowError("Erreur au chargement des donnéés", "Demande");
            }
        }
Пример #23
0
 private void RetourneInfoCompteurduClient(CsClient leClient)
 {
     try
     {
         prgBar.Visibility = System.Windows.Visibility.Visible;
         Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
         client.ChargerDetailClientCompleted += (ssender, args) =>
         {
             prgBar.Visibility = System.Windows.Visibility.Collapsed;
             if (args.Cancelled || args.Error != null)
             {
                 LayoutRoot.Cursor = Cursors.Arrow;
                 string error = args.Error.Message;
                 Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                 return;
             }
             if (args.Result == null)
             {
                 LayoutRoot.Cursor = Cursors.Arrow;
                 Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                 return;
             }
             else
             {
                 laDDe = args.Result;
                 this.Txt_CodeCentre.Text     = string.IsNullOrEmpty(laDetailDemande.LaDemande.CENTRE) ? string.Empty : laDetailDemande.LaDemande.CENTRE;
                 this.Txt_LibelleCentre.Text  = string.IsNullOrEmpty(laDetailDemande.LaDemande.LIBELLECENTRE) ? string.Empty : laDetailDemande.LaDemande.LIBELLECENTRE;
                 this.Txt_CodeProduit.Text    = string.IsNullOrEmpty(laDetailDemande.LaDemande.PRODUIT) ? string.Empty : laDetailDemande.LaDemande.PRODUIT;
                 this.Txt_LibelleProduit.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.LIBELLEPRODUIT) ? string.Empty : laDetailDemande.LaDemande.LIBELLEPRODUIT;
                 this.Txt_NumDemande.Text     = string.IsNullOrEmpty(laDetailDemande.LaDemande.NUMDEM) ? string.Empty : laDetailDemande.LaDemande.NUMDEM;
                 this.Txt_Client.Text         = string.IsNullOrEmpty(laDetailDemande.LaDemande.CLIENT) ? string.Empty : laDetailDemande.LaDemande.CLIENT;
                 if (laDetailDemande.LstCanalistion != null && laDetailDemande.LstCanalistion.Count != 0 &&
                     laDDe.LstCanalistion != null && laDDe.LstCanalistion.Count != 0)
                 {
                     if (laDDe.LstCanalistion.First().PRODUIT == SessionObject.Enumere.ElectriciteMT)
                     {
                         this.Txt_LibelleDiametre.IsEnabled = false;
                         laDDe.LstCanalistion.First().NUMERO = laDDe.LstCanalistion.First().NUMERO.Substring(5, (laDDe.LstCanalistion.First().NUMERO.Length - 5));
                     }
                     AfficherCannalisation(laDetailDemande.LstCanalistion.First(), laDDe.LstCanalistion.First());
                     AfficherDocumentScanne(laDetailDemande.ObjetScanne);
                 }
                 Txt_Motif.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.MOTIF) ? string.Empty : laDetailDemande.LaDemande.MOTIF;
             }
         };
         client.ChargerDetailClientAsync(leClient);
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (txt_Ref_Branchement.Text.Length == 11)
     {
         allowProgressBar();
         CsClient leClient = new CsClient();
         leClient.FK_IDCENTRE = (int)this.txtCentre.Tag;
         leClient.CENTRE      = this.txtCentre.Text;
         leClient.REFCLIENT   = this.txt_Ref_Branchement.Text;
         leClient.PRODUIT     = this.txtProduit.Text;
         RetourneOrdre(leClient);
     }
 }
        private void ChargeDetailDEvis(CsClient leclient)
        {
            try
            {
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                client.GeDetailByFromClientCompleted += (ssender, args) =>
                {
                    if (args.Cancelled || args.Error != null)
                    {
                        LayoutRoot.Cursor = Cursors.Arrow;
                        string error = args.Error.Message;
                        Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    if (args.Result == null)
                    {
                        LayoutRoot.Cursor = Cursors.Arrow;
                        Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    else
                    {
                        laDetailDemande = new CsDemande();
                        laDetailDemande = args.Result;
                        if (laDetailDemande.Abonne != null && !string.IsNullOrEmpty(laDetailDemande.Abonne.CLIENT))
                        {
                            //if (laDetailDemande.Abonne.AVANCE == 0 || laDetailDemande.Abonne.AVANCE == null)
                            //{
                            //    Message.ShowInformation("Ce client n'a pas d'avance positionné,Veuillez modifier l'abonnement .", "Acceuil");
                            //    return;
                            //}
                        }
                        this.txtSite.Text     = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLESITE) ? string.Empty : laDetailDemande.LeClient.LIBELLESITE;
                        this.txtCentre.Text   = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLECENTRE) ? string.Empty : laDetailDemande.LeClient.LIBELLECENTRE;
                        this.txt_Produit.Text = string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEPRODUIT) ? string.Empty : laDetailDemande.Abonne.LIBELLEPRODUIT;
                        this.txt_tdem.Text    = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).LIBELLE;
                        txt_tdem.Tag          = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem);
                        RemplireOngletClient(laDetailDemande.LeClient);
                        RemplirOngletAbonnement(laDetailDemande.Abonne);

                        ChargerCompteDeResiliation(laDetailDemande.LeClient);
                    }
                    LayoutRoot.Cursor = Cursors.Arrow;
                };
                client.GeDetailByFromClientAsync(leclient);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #26
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 RetourneAbonClient(CsClient leClient)
        {
            try
            {
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                client.ChargerDetailClientCompleted += (ssender, args) =>
                {
                    if (args.Cancelled || args.Error != null)
                    {
                        LayoutRoot.Cursor = Cursors.Arrow;
                        string error = args.Error.Message;
                        Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    if (args.Result == null)
                    {
                        LayoutRoot.Cursor = Cursors.Arrow;
                        Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis);
                        return;
                    }
                    else
                    {
                        laDDe = args.Result;
                    }
                    if (laDDe.Abonne.PRODUIT == SessionObject.Enumere.ElectriciteMT)
                    {
                        this.Txt_NouvTypeComptage.Visibility = System.Windows.Visibility.Visible;
                        this.Txt_TypeComptage.Visibility     = System.Windows.Visibility.Visible;

                        lbl_TypeComptage.Visibility     = System.Windows.Visibility.Visible;
                        lbl_NouvTypeComptage.Visibility = System.Windows.Visibility.Visible;
                    }

                    if (laDDe.Abonne.PRODUIT == SessionObject.Enumere.Eau)
                    {
                        this.chk_EstBornePoste.Visibility    = System.Windows.Visibility.Collapsed;
                        this.chk_EstBornePosteNew.Visibility = System.Windows.Visibility.Collapsed;
                    }


                    AfficherInfoAbonnement(laDetailDemande, laDDe);
                    AfficherDocumentScanne(laDetailDemande.ObjetScanne);
                };
                client.ChargerDetailClientAsync(leClient);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public FrmPayementAnticipe(CsClient LeClient, string _LibelleTypeFacture)
 {
     InitializeComponent();
     try
     {
         LeClientNaf        = LeClient;
         LibelleTypeFacture = _LibelleTypeFacture;
         nomAbon            = LeClient.NOMABON;
         solde           = LeClient.SOLDE;
         referenceClient = LeClient.CENTRE + LeClient.REFCLIENT + LeClient.ORDRE;
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
        private void Btn_Recherche_Click(object sender, RoutedEventArgs e)
        {
            this.Txt_NouvIndex.Text        = string.Empty;
            this.Txt_AncIndex.Text         = string.Empty;
            this.Cbo_Compteur.SelectedItem = null;
            this.Txt_NomAbon.Text          = string.Empty;

            if (this.Txt_CodeCentre.Tag != null && !string.IsNullOrEmpty(this.Txt_PeriodeEnCour.Text))
            {
                int      idcentre = int.Parse(this.Txt_CodeCentre.Tag.ToString());
                CsClient leClient = new CsClient();
                leClient.CENTRE    = Txt_CodeCentre.Text;
                leClient.REFCLIENT = this.txtClient.Text;
                leClient.PRODUIT   = this.Txt_Produit.Tag.ToString();

                leClient.FK_IDCENTRE = idcentre;
                string OrdreMax = string.Empty;
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                service.RetourneOrdreMaxCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    OrdreMax = args.Result;
                    if (OrdreMax != null)
                    {
                        leClient.ORDRE     = OrdreMax;
                        this.txtOrdre.Text = OrdreMax;
                        RetourneInfoClient(leClient);
                    }
                    else
                    {
                        Message.ShowInformation("Abonnement non trouvé", "Facturation");
                        return;
                    }
                };
                service.RetourneOrdreMaxAsync(leClient.FK_IDCENTRE.Value, leClient.CENTRE, leClient.REFCLIENT, leClient.PRODUIT);
                service.CloseAsync();
            }
            else
            {
                Message.ShowInformation("Saisir la période à modifier", "Facturation");
                return;
            }
        }
        public void RetourneEtatClient(CsClient leClient)
        {
            try
            {
                this.DialogResult = true;
                CaisseServiceClient srv = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                srv.RetourneEtatClientAsync(leClient.PK_ID);
                srv.RetourneEtatClientCompleted += (factor, es) =>
                {
                    if (es.Error != null || es.Cancelled)
                    {
                        Message.ShowError("L'insertion des encaissements a retournée une erreur. Réessayer svp! :" + es.Error.Message, "Erreur");
                        return;
                    }
                    if (es.Result == null)
                    {
                        Message.ShowError("L'insertion des encaissements a retournée une erreur. Réessayer svp!", "Erreur");
                        return;
                    }
                    decimal?         MontantExigible    = es.Result.Where(t => t.EXIGIBILITE < System.DateTime.Today.Date).Sum(y => y.MONTANT);
                    decimal?         MontantNonExigible = es.Result.Where(t => t.EXIGIBILITE > System.DateTime.Today.Date).Sum(y => y.MONTANT);
                    decimal?         Solde = MontantExigible + MontantNonExigible;
                    List <CsLclient> lstFactureDuClient = _ListeDesReglementDuRecu.Where(t => t.FK_IDCLIENT == leClient.PK_ID).ToList();

                    foreach (CsLclient item in lstFactureDuClient)
                    {
                        item.MONTANTEXIGIBLE    = MontantExigible;
                        item.MONTANTNONEXIGIBLE = MontantNonExigible;
                        item.SOLDECLIENT        = Solde;
                    }
                    List <CsReglementRecu> _ListeDesRecu = Galatee.Silverlight.Caisse.EditionRecu.ReorganiserReglement(lstFactureDuClient, SessionObject.Enumere.ActionRecuDuplicat);
                    int nbreDeCopie = 2;
                    for (int i = 1; i <= nbreDeCopie; i++)
                    {
                        string key = Utility.getKey();
                        Dictionary <string, string> param = new Dictionary <string, string>();
                        param.Add("pTypeRecu", "RECU D'ANNULATION D'ENCAISSEMENT");
                        LanceImpression(key, param, _ListeDesRecu, false);
                    }
                };
            }
            catch (Exception)
            {
                throw;
            }
        }