コード例 #1
0
        private void chargerInformation()
        {
            if (LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.Reabonnement ||
                LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.DimunitionPuissance ||
                LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.AugmentationPuissance)
            {
                if (!IsUpdate)
                {
                    RetourneInfoAbon(LaDemande.LaDemande.FK_IDCENTRE, LaDemande.LaDemande.CENTRE, LaDemande.LaDemande.CLIENT, LaDemande.LaDemande.ORDRE, LaDemande.LaDemande.PRODUIT);
                }
                this.Txt_DateResiliation.IsReadOnly = true;
            }
            else if (LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.BranchementAbonement ||
                     LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.AbonnementSeul)
            {
                this.Txt_DateResiliation.Visibility = System.Windows.Visibility.Collapsed;
                this.lbl_DateResiliation.Visibility = System.Windows.Visibility.Collapsed;
                this.Txt_DateAbonnement.Text        = DateTime.Now.ToShortDateString();
            }

            if (IsUpdate)
            {
                CsAbon _LAbon = new CsAbon();
                if (LaDemande.Abonne != null)
                {
                    _LAbon = LaDemande.Abonne;
                }
                AfficherInfoAbonnement(_LAbon);
                if (typeDemande != SessionObject.Enumere.ModificationAbonnement)
                {
                    EnregistrerDemande(LaDemande);
                }
            }
        }
コード例 #2
0
        private void RemplirOngletAbonnement(CsAbon _LeAbon)
        {
            if (_LeAbon != null)
            {
                this.Txt_CodeTarif.Text            = !string.IsNullOrEmpty(_LeAbon.TYPETARIF) ? _LeAbon.TYPETARIF : string.Empty;
                this.Txt_CodePussanceSoucrite.Text = !string.IsNullOrEmpty(_LeAbon.PUISSANCE.Value.ToString()) ? _LeAbon.PUISSANCE.Value.ToString() : string.Empty;

                if (_LeAbon.PUISSANCE != null)
                {
                    this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(_LeAbon.PUISSANCE.ToString()).ToString("N2");
                }
                if (_LeAbon.PUISSANCEUTILISEE != null)
                {
                    this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(_LeAbon.PUISSANCEUTILISEE.Value).ToString("N2");
                }

                this.Txt_CodeForfait.Text    = string.IsNullOrEmpty(_LeAbon.FORFAIT) ? string.Empty : _LeAbon.FORFAIT;
                this.Txt_LibelleForfait.Text = string.IsNullOrEmpty(_LeAbon.LIBELLEFORFAIT) ? string.Empty : _LeAbon.LIBELLEFORFAIT;

                this.Txt_CodeTarif.Text    = string.IsNullOrEmpty(_LeAbon.TYPETARIF) ? string.Empty : _LeAbon.TYPETARIF;
                this.Txt_LibelleTarif.Text = !string.IsNullOrEmpty(_LeAbon.LIBELLETARIF) ? _LeAbon.LIBELLETARIF : string.Empty;

                this.Txt_CodeFrequence.Text    = string.IsNullOrEmpty(_LeAbon.PERFAC) ? string.Empty : _LeAbon.PERFAC;
                this.Txt_LibelleFrequence.Text = !string.IsNullOrEmpty(_LeAbon.LIBELLEFREQUENCE) ? _LeAbon.LIBELLEFREQUENCE : string.Empty;

                this.Txt_CodeMoisIndex.Text    = string.IsNullOrEmpty(_LeAbon.MOISREL) ? string.Empty : _LeAbon.MOISREL;
                this.Txt_LibelleMoisIndex.Text = !string.IsNullOrEmpty(_LeAbon.LIBELLEMOISIND) ? _LeAbon.LIBELLEMOISIND : string.Empty;

                this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(_LeAbon.MOISFAC) ? string.Empty : _LeAbon.MOISFAC;
                this.Txt_LibMoisFact.Text         = !string.IsNullOrEmpty(_LeAbon.LIBELLEMOISFACT) ? _LeAbon.LIBELLEMOISFACT : string.Empty;

                this.Txt_DateAbonnement.Text = (_LeAbon.DABONNEMENT == null) ?string.Empty  : Convert.ToDateTime(_LeAbon.DABONNEMENT.Value).ToShortDateString();
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
 private void RetourneInfoAbon(int fk_idcentre, string centre, string client, string ordre, string produit)
 {
     try
     {
         AbonementRecherche = new List <CsAbon>();
         AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.RetourneAbonCompleted += (s, args) =>
         {
             if (args != null && args.Cancelled)
             {
                 return;
             }
             AbonementRecherche = args.Result;
             if (AbonementRecherche != null)
             {
                 CsAbon _LeAbonnementProduit = AbonementRecherche.FirstOrDefault(p => p.PRODUIT == produit);
                 LaDemande.Abonne = _LeAbonnementProduit;
                 AfficherInfoAbonnement(LaDemande.Abonne);
             }
         };
         service.RetourneAbonAsync(fk_idcentre, centre, client, ordre);
         service.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
        private void RenseignerInformationsDevis(CsAbon leAbon)
        {
            try
            {
                if (leAbon != null)
                {
                    CsCentre leCentre = SessionObject.LstCentre.FirstOrDefault(t => t.PK_ID == leAbon.FK_IDCENTRE);

                    Txt_CodeSite.Text       = !string.IsNullOrEmpty(leCentre.CODESITE) ? leCentre.CODESITE : string.Empty;
                    Txt_CodeCentre.Text     = !string.IsNullOrEmpty(leAbon.CENTRE) ? leAbon.CENTRE : string.Empty;
                    Txt_LibelleCentre.Text  = !string.IsNullOrEmpty(leAbon.LIBELLECENTRE) ? leAbon.LIBELLECENTRE : string.Empty;
                    Txt_CodeProduit.Text    = !string.IsNullOrEmpty(leAbon.PRODUIT) ? leAbon.PRODUIT : string.Empty;
                    Txt_LibelleSite.Text    = !string.IsNullOrEmpty(leCentre.LIBELLESITE) ? leCentre.LIBELLESITE : string.Empty;
                    Txt_LibelleProduit.Text = !string.IsNullOrEmpty(leAbon.LIBELLEPRODUIT) ? leAbon.LIBELLEPRODUIT : string.Empty;

                    if (laDetailDemande.LstCanalistion != null && laDetailDemande.LstCanalistion.Count != 0)
                    {
                        Txt_Compteur.Text = laDetailDemande.LstCanalistion.First().NUMERO;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        private void RetourneEvenementCanalisation(CsAbon LeAbonnement, string Periode)
        {
            try
            {
                AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.RetourneEvenementCanalisationPeriodeAsync(LeAbonnement, Periode);
                service.RetourneEvenementCanalisationPeriodeCompleted += (s, args) =>
                {
                    try
                    {
                        if (args != null && args.Cancelled)
                        {
                            return;
                        }
                        LstEvenement = args.Result;
                        if (LstEvenement != null && LstEvenement.Count != 0)
                        {
                            foreach (CsEvenement item in LstEvenement)
                            {
                                if (item.ETATCOMPTEUR == SessionObject.Enumere.CompteurActifValeur)
                                {
                                    item.LIBELLEETATCOMPTEUR = SessionObject.Enumere.CompteurActif;
                                }
                                else
                                {
                                    item.LIBELLEETATCOMPTEUR = SessionObject.Enumere.CompteurInactifValeur;
                                }
                            }
                            this.dataGrid1.ItemsSource = null;
                            this.dataGrid1.ItemsSource = LstEvenement;
                            if (LstEvenement != null && LstEvenement.Count != 0)
                            {
                                this.dataGrid1.SelectedItem = LstEvenement.First();
                            }

                            if (LstEvenement.FirstOrDefault(t => t.ISEVENEMENTNONFACURE == true) != null)
                            {
                                Message.ShowInformation("Un événement non saisi existe sur ce client . " + "\n\r " + "Il sera supprimé par la facture isolé", "Erreur");
                            }
                        }
                        else
                        {
                            Message.ShowInformation("Aucun evenement trouvé pour ce client", "Erreur");
                        }
                    }
                    catch (Exception ex)
                    {
                        Message.ShowWarning(ex.Message, Langue.Msg_LeClientEstEnFacturation);
                    }
                };
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #8
0
 private void AfficherInfoAbonnement(CsAbon _LeAbonnementdemande)
 {
     try
     {
         this.Txt_MontantAncAvance.Text = string.IsNullOrEmpty(_LeAbonnementdemande.AVANCE.ToString()) ? string.Empty : Convert.ToDecimal(_LeAbonnementdemande.AVANCE).ToString(SessionObject.FormatMontant);
         this.Txt_DateAncAvance.Text    = _LeAbonnementdemande.DAVANCE == null   ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DAVANCE).ToShortDateString();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #9
0
        public UcDemandeDetailAbonnement(CsAbon _leAbonnement)
        {
            InitializeComponent();
            translate();
            _UnAbon = _leAbonnement;
            AfficherInfoAbonnement(_leAbonnement);
            RemplireLibelle();
            typeDemande = SessionObject.Enumere.ModificationAbonnement;
            IsControleInactif(true);
            this.btn_PussSouscrite.IsEnabled = false;

            this.Txt_CodeFrequence.MaxLength = 1;
        }
コード例 #10
0
        private void RetourneInfoAbon(int fk_idCentre, string centre, string client, string ordre, string produit)
        {
            int res = LoadingManager.BeginLoading(Langue.En_Cours);

            try
            {
                List <CsAbon>        AbonementRecherche = new List <CsAbon>();
                AcceuilServiceClient service            = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.RetourneAbonCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    AbonementRecherche = args.Result;
                    if (AbonementRecherche != null)
                    {
                        CsAbon  _LeAbonnementProduit = AbonementRecherche.FirstOrDefault(p => p.PRODUIT == produit);
                        TabItem tabItem1             = new TabItem();
                        tabItem1.Header  = "ANCIENNES DONNEES";
                        _LectrlAbonement = new UcDemandeDetailAbonnement(_LeAbonnementProduit);

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

                        laDemande.Abonne.PK_ID = _LeAbonnementProduit.PK_ID;

                        TabItem tabItem2 = new TabItem();
                        tabItem2.Header  = "NOUVELLES DONNEES";
                        _LectrlAbonement = new UcDemandeDetailAbonnement(laDemande, true);
                        tabItem2.Content = _LectrlAbonement;
                        tabControl1.Items.Add(tabItem2);
                        tabControl1.SelectedItem = tabItem2;
                        LoadingManager.EndLoading(res);
                    }
                };
                service.RetourneAbonAsync(fk_idCentre, centre, client, ordre);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                LoadingManager.EndLoading(res);
                throw ex;
            }
        }
コード例 #11
0
 private void RetourneEvenementCanalisation(CsAbon LeAbonnement)
 {
     try
     {
         AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.RetourneDernierEvenementDeLaCanalisationAsync(LeAbonnement);
         service.RetourneDernierEvenementDeLaCanalisationCompleted += (s, args) =>
         {
             try
             {
                 if (args != null && args.Cancelled)
                 {
                     return;
                 }
                 LstEvenement = args.Result;
                 foreach (CsEvenement item in LstEvenement)
                 {
                     if (item.ETATCOMPTEUR == SessionObject.Enumere.CompteurActifValeur)
                     {
                         item.LIBELLEETATCOMPTEUR = SessionObject.Enumere.CompteurActif;
                     }
                     else
                     {
                         item.LIBELLEETATCOMPTEUR = SessionObject.Enumere.CompteurInactifValeur;
                     }
                 }
                 this.dataGrid1.ItemsSource = null;
                 this.dataGrid1.ItemsSource = LstEvenement;
                 if (LstEvenement != null && LstEvenement.Count != 0)
                 {
                     this.dataGrid1.SelectedItem = LstEvenement.First();
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowWarning(ex.Message, Langue.Msg_LeClientEstEnFacturation);
             }
         };
         service.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #12
0
 private void InitialiseCtrl()
 {
     try
     {
         this.Txt_Client.Text   = LaDemande.LaDemande.CLIENT;
         this.Txt_Addresse.Text = LaDemande.LaDemande.CLIENT;
         this.Txt_Ordre.Text    = LaDemande.LaDemande.ORDRE;
         CsAbon _LAbon = new CsAbon();
         if (LaDemande.Abonne != null)
         {
             _LAbon = LaDemande.Abonne;
         }
         AfficherInfoAbonnement(_LAbon);
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message + "=>InitialiseCtrl", Langue.lbl_Menu);
     }
 }
コード例 #13
0
        private void RenseignerInformationsAbonnement(CsAbon leAbon)
        {
            try
            {
                if (leAbon != null && leAbon != null)
                {
                    this.Txt_CodePuissanceUtilise.Text = laDetailDemande.Branchement.PUISSANCEINSTALLEE.ToString();
                    this.Txt_CodeTarif.Text            = !string.IsNullOrEmpty(laDetailDemande.Abonne.TYPETARIF) ? laDetailDemande.Abonne.TYPETARIF : string.Empty;
                    this.Txt_CodePussanceSoucrite.Text = !string.IsNullOrEmpty(laDetailDemande.Abonne.PUISSANCE.Value.ToString()) ? laDetailDemande.Abonne.PUISSANCE.Value.ToString() : string.Empty;

                    if (laDetailDemande.Abonne.PUISSANCE != null)
                    {
                        this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(laDetailDemande.Abonne.PUISSANCE.ToString()).ToString("N2");
                    }
                    if (laDetailDemande.Abonne.PUISSANCEUTILISEE != null)
                    {
                        this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(laDetailDemande.Abonne.PUISSANCEUTILISEE.Value).ToString("N2");
                    }
                    this.Txt_CodeRistoune.Text = string.IsNullOrEmpty(laDetailDemande.Abonne.RISTOURNE.ToString()) ? string.Empty : Convert.ToDecimal(laDetailDemande.Abonne.RISTOURNE.Value).ToString("N2");

                    this.Txt_CodeForfait.Text    = string.IsNullOrEmpty(laDetailDemande.Abonne.FORFAIT) ? string.Empty : laDetailDemande.Abonne.FORFAIT;
                    this.Txt_LibelleForfait.Text = string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEFORFAIT) ? string.Empty : laDetailDemande.Abonne.LIBELLEFORFAIT;

                    this.Txt_CodeTarif.Text    = string.IsNullOrEmpty(laDetailDemande.Abonne.TYPETARIF) ? string.Empty : laDetailDemande.Abonne.TYPETARIF;
                    this.Txt_LibelleTarif.Text = !string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLETARIF) ? laDetailDemande.Abonne.LIBELLETARIF : string.Empty;

                    this.Txt_CodeFrequence.Text    = string.IsNullOrEmpty(laDetailDemande.Abonne.PERFAC) ? string.Empty : laDetailDemande.Abonne.PERFAC;
                    this.Txt_LibelleFrequence.Text = !string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEFREQUENCE) ? laDetailDemande.Abonne.LIBELLEFREQUENCE : string.Empty;

                    this.Txt_CodeMoisIndex.Text    = string.IsNullOrEmpty(laDetailDemande.Abonne.MOISREL) ? string.Empty : laDetailDemande.Abonne.MOISREL;
                    this.Txt_LibelleMoisIndex.Text = !string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEMOISIND) ? laDetailDemande.Abonne.LIBELLEMOISIND : string.Empty;

                    this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(laDetailDemande.Abonne.MOISFAC) ? string.Empty : laDetailDemande.Abonne.MOISFAC;
                    this.Txt_LibMoisFact.Text         = !string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEMOISFACT) ? laDetailDemande.Abonne.LIBELLEMOISFACT : string.Empty;
                    this.Txt_DateAbonnement.Text      = (laDetailDemande.Abonne.DABONNEMENT == null) ? DateTime.Now.ToShortDateString() : Convert.ToDateTime(laDetailDemande.Abonne.DABONNEMENT.Value).ToShortDateString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #14
0
        private void RetourneInfoAbon(int fk_idcentre, string centre, string client, string ordre, string produit)
        {
            AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            service.RetourneAbonCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result != null)
                {
                    AbonementRecherche = args.Result.FirstOrDefault(p => p.PRODUIT == produit);
                    if (AbonementRecherche != null && !string.IsNullOrEmpty(AbonementRecherche.CENTRE))
                    {
                        if (LaDemande.Abonne != null)
                        {
                            AbonementRecherche.NUMDEM = LaDemande.LaDemande.NUMDEM;
                            if (LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.Resiliation)
                            {
                                AbonementRecherche.DRES = LaDemande.Abonne.DRES;
                            }
                            LaDemande.Abonne = AbonementRecherche;
                        }
                        //SetDemandeFromAbon(AbonementRecherche, ref LaDemande);
                        //if (LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.FactureManuelle ||
                        //    LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.Resiliation ||
                        //    LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.AvoirConsomation)
                        //{
                        //    this.Txt_PeriodeEnCour.IsReadOnly = false;
                        //    this.Txt_PeriodeEnCour.Background = new SolidColorBrush(Colors.Cyan);
                        //    this.Txt_PeriodeEnCour.Focus();
                        //}
                    }
                }
            };
            service.RetourneAbonAsync(fk_idcentre, centre, client, ordre);
            service.CloseAsync();
        }
コード例 #15
0
        public UcDemandeDetailAbonnement(CsDemande _LaDemande, bool _IsUpdate)
        {
            InitializeComponent();
            translate();
            SessionObject.EtatControlCourant = true;
            LaDemande   = _LaDemande;
            typeDemande = _LaDemande.LaDemande.TYPEDEMANDE;
            if (LaDemande.Abonne == null)
            {
                LaDemande.Abonne = new CsAbon();
            }
            _UnAbon = LaDemande.Abonne;
            ChargerFrequence();
            ChargerApplicationTaxe();
            ChargerMois();
            ChargerTarif();
            ChargerForfait();
            ChargerPuissance();

            this.Txt_Client.Text   = string.IsNullOrEmpty(LaDemande.LaDemande.CLIENT) ? string.Empty : LaDemande.LaDemande.CLIENT;
            this.Txt_Addresse.Text = string.IsNullOrEmpty(LaDemande.LaDemande.REFEM) ? string.Empty : LaDemande.LaDemande.REFEM;
            this.Txt_Ordre.Text    = string.IsNullOrEmpty(LaDemande.LaDemande.ORDRE) ? string.Empty : LaDemande.LaDemande.ORDRE;

            this.Txt_CodePussanceSoucrite.Text = InitValue.ToString("N2");
            this.Txt_CodePuissanceUtilise.Text = InitValue.ToString("N2");
            this.Txt_Consomation.Text          = InitValue.ToString("N2");
            this.Txt_CodeRistoune.Text         = InitValue.ToString("N2");
            if (LaDemande.LaDemande.PRODUIT != SessionObject.Enumere.Electricite)
            {
                this.Txt_CodePussanceSoucrite.IsReadOnly = true;
                this.Txt_CodePuissanceUtilise.IsReadOnly = true;
                this.Txt_Consomation.IsReadOnly          = true;
                this.Txt_CodeRistoune.IsReadOnly         = true;
            }
            IsUpdate = _IsUpdate;
            chargerInformation();
        }
        private void AfficherInfoAbonnement(CsDemande _NouvelDemande, CsDemande _LeAncdemande)
        {
            try
            {
                CsAbon _LeAbonnementdemande = _LeAncdemande.Abonne;
                CsAbon _NouvelInfoAbon      = _NouvelDemande.Abonne;
                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;
                this.Txt_Ordre.Text          = string.IsNullOrEmpty(laDetailDemande.LaDemande.ORDRE) ? string.Empty : laDetailDemande.LaDemande.ORDRE;

                if (_LeAbonnementdemande != null)
                {
                    if (_LeAbonnementdemande.PUISSANCE != null)
                    {
                        this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCE.ToString()).ToString("N2");
                    }
                    if (_LeAncdemande.Branchement != null && _LeAncdemande.Branchement.PUISSANCEINSTALLEE != null)
                    {
                        this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(_LeAncdemande.Branchement.PUISSANCEINSTALLEE).ToString("N2");
                    }
                    this.Txt_CodeForfait.Text    = string.IsNullOrEmpty(_LeAbonnementdemande.FORFAIT) ? string.Empty : _LeAbonnementdemande.FORFAIT;
                    this.Txt_LibelleForfait.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEFORFAIT) ? string.Empty : _LeAbonnementdemande.LIBELLEFORFAIT;

                    this.Txt_CodeTarif.Text    = string.IsNullOrEmpty(_LeAbonnementdemande.TYPETARIF) ? string.Empty : _LeAbonnementdemande.TYPETARIF;
                    this.Txt_LibelleTarif.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLETARIF) ? string.Empty : _LeAbonnementdemande.LIBELLETARIF;

                    this.Txt_CodeFrequence.Text    = string.IsNullOrEmpty(_LeAbonnementdemande.PERFAC) ? string.Empty : _LeAbonnementdemande.PERFAC;
                    this.Txt_LibelleFrequence.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEFREQUENCE) ? string.Empty : _LeAbonnementdemande.LIBELLEFREQUENCE;



                    this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(_LeAbonnementdemande.MOISFAC) ? string.Empty : _LeAbonnementdemande.MOISFAC;
                    this.Txt_LibMoisFact.Text         = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEMOISFACT) ? string.Empty : _LeAbonnementdemande.LIBELLEMOISFACT;
                    this.Txt_DateAbonnement.Text      = (_LeAbonnementdemande.DABONNEMENT == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DABONNEMENT.Value).ToShortDateString();
                    this.Txt_DateResiliation.Text     = (_LeAbonnementdemande.DRES == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DRES.Value).ToShortDateString();


                    this.txt_DebutPeriodeExo.Text = string.IsNullOrEmpty(_LeAbonnementdemande.DEBUTEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeAbonnementdemande.DEBUTEXONERATIONTVA);
                    this.txt_FinPeriodeExo.Text   = string.IsNullOrEmpty(_LeAbonnementdemande.FINEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeAbonnementdemande.FINEXONERATIONTVA);

                    this.chk_EstBornePoste.IsChecked = (_LeAbonnementdemande.ISBORNEPOSTE != null && _LeAbonnementdemande.ISBORNEPOSTE.Value) ? true : false;

                    this.Txt_AvanceSurConso.Text = _LeAbonnementdemande.AVANCE == null ? "0" : Convert.ToDecimal(_LeAbonnementdemande.AVANCE.Value).ToString(SessionObject.FormatMontant);
                    this.Txt_TypeComptage.Text   = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLETYPECOMPTAGE) ? string.Empty : _LeAbonnementdemande.LIBELLETYPECOMPTAGE;

                    if (_LeAncdemande.LeClient != null)
                    {
                        this.Txt_AncCodeCategorie.Text    = string.IsNullOrEmpty(_LeAncdemande.LeClient.CATEGORIE) ? string.Empty : _LeAncdemande.LeClient.CATEGORIE;
                        this.Txt_AncLibelleCategorie.Text = string.IsNullOrEmpty(_LeAncdemande.LeClient.LIBELLECATEGORIE) ? string.Empty : _LeAncdemande.LeClient.LIBELLECATEGORIE;
                    }
                }
                if (_NouvelInfoAbon != null)
                {
                    if (_NouvelInfoAbon.PUISSANCE != null)
                    {
                        this.Txt_NouvCodePussanceSoucrite.Text = Convert.ToDecimal(_NouvelInfoAbon.PUISSANCE.ToString()).ToString("N2");
                    }

                    if (_NouvelDemande.Branchement != null && _NouvelDemande.Branchement.PUISSANCEINSTALLEE != null)
                    {
                        this.Txt_NouvCodePuissanceUtilise.Text = Convert.ToDecimal(_NouvelDemande.Branchement.PUISSANCEINSTALLEE).ToString("N2");
                    }

                    this.Txt_NouvCodeForfait.Text    = string.IsNullOrEmpty(_NouvelInfoAbon.FORFAIT) ? string.Empty : _NouvelInfoAbon.FORFAIT;
                    this.Txt_NouvLibelleForfait.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEFORFAIT) ? string.Empty : _NouvelInfoAbon.LIBELLEFORFAIT;

                    this.Txt_NouvCodeTarif.Text    = string.IsNullOrEmpty(_NouvelInfoAbon.TYPETARIF) ? string.Empty : _NouvelInfoAbon.TYPETARIF;
                    this.Txt_NouvLibelleTarif.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLETARIF) ? string.Empty : _NouvelInfoAbon.LIBELLETARIF;


                    this.Txt_NouvCodeFrequence.Text    = string.IsNullOrEmpty(_NouvelInfoAbon.PERFAC) ? string.Empty : _NouvelInfoAbon.PERFAC;
                    this.Txt_NouvLibelleFrequence.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEFREQUENCE) ? string.Empty : _NouvelInfoAbon.LIBELLEFREQUENCE;

                    this.Txt_NouvCodeMoisFacturation.Text = string.IsNullOrEmpty(_NouvelInfoAbon.MOISFAC) ? string.Empty : _NouvelInfoAbon.MOISFAC;
                    this.Txt_NouvLibMoisFact.Text         = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEMOISFACT) ? string.Empty : _NouvelInfoAbon.LIBELLEMOISFACT;

                    this.txt_NouvelleDebutPeriodeExo.Text = string.IsNullOrEmpty(_NouvelInfoAbon.DEBUTEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_NouvelInfoAbon.DEBUTEXONERATIONTVA);
                    this.txt_NouvelleFinPeriodeExo.Text   = string.IsNullOrEmpty(_NouvelInfoAbon.FINEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_NouvelInfoAbon.FINEXONERATIONTVA);

                    this.chk_EstBornePoste.IsChecked = (_NouvelInfoAbon.ISBORNEPOSTE.Value) ? true : false;


                    this.Txt_NouvDateAbonnement.Text  = (_NouvelInfoAbon.DABONNEMENT == null) ? string.Empty : Convert.ToDateTime(_NouvelInfoAbon.DABONNEMENT.Value).ToShortDateString();
                    this.Txt_NouvDateResiliation.Text = (_NouvelInfoAbon.DRES == null) ? string.Empty : Convert.ToDateTime(_NouvelInfoAbon.DRES.Value).ToShortDateString();

                    this.Txt_NouvAvanceSurConso.Text = _NouvelInfoAbon.AVANCE == null ? "0" : Convert.ToDecimal(_NouvelInfoAbon.AVANCE.Value).ToString(SessionObject.FormatMontant);
                    this.Txt_NouvTypeComptage.Text   = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLETYPECOMPTAGE) ? string.Empty  : _NouvelInfoAbon.LIBELLETYPECOMPTAGE;

                    if (_NouvelDemande.LeClient != null)
                    {
                        this.Txt_Categorie.Text        = string.IsNullOrEmpty(_NouvelDemande.LeClient.CATEGORIE) ? string.Empty : _NouvelDemande.LeClient.CATEGORIE;
                        this.Txt_LibelleCategorie.Text = string.IsNullOrEmpty(_NouvelDemande.LeClient.LIBELLECATEGORIE) ? string.Empty : _NouvelDemande.LeClient.LIBELLECATEGORIE;
                    }
                }
                if (laDetailDemande.ObjetScanne != null && laDetailDemande.ObjetScanne.Count != 0)
                {
                    dgListePiece.ItemsSource = this.LstPiece;
                }


                if (this.Txt_NouvCodeTarif.Text != this.Txt_CodeTarif.Text)
                {
                    this.Txt_NouvCodeTarif.FontWeight    = FontWeights.ExtraBold;
                    this.Txt_NouvLibelleTarif.FontWeight = FontWeights.ExtraBold;
                    this.Txt_NouvLibelleTarif.FontStyle  = FontStyles.Italic;
                    this.Txt_NouvCodeTarif.FontStyle     = FontStyles.Italic;
                }
                if (this.Txt_NouvCodeForfait.Text != this.Txt_CodeForfait.Text)
                {
                    this.Txt_NouvCodeForfait.FontWeight = FontWeights.ExtraBold;
                    this.Txt_NouvCodeForfait.FontWeight = FontWeights.ExtraBold;
                    this.Txt_NouvCodeForfait.FontStyle  = FontStyles.Italic;
                    this.Txt_NouvLibelleTarif.FontStyle = FontStyles.Italic;
                }
                if (this.Txt_NouvCodeFrequence.Text != this.Txt_CodeFrequence.Text)
                {
                    this.Txt_NouvCodeFrequence.FontWeight    = FontWeights.ExtraBold;
                    this.Txt_NouvLibelleFrequence.FontWeight = FontWeights.ExtraBold;
                    this.Txt_NouvLibelleFrequence.FontStyle  = FontStyles.Italic;
                    this.Txt_NouvCodeFrequence.FontStyle     = FontStyles.Italic;
                }
                if (this.Txt_NouvCodeMoisFacturation.Text != this.Txt_CodeMoisFacturation.Text)
                {
                    this.Txt_NouvCodeMoisFacturation.FontWeight = FontWeights.Bold;
                    this.Txt_NouvCodeMoisFacturation.FontStyle  = FontStyles.Italic;
                    this.Txt_NouvLibMoisFact.FontWeight         = FontWeights.ExtraBold;
                    this.Txt_NouvLibMoisFact.FontStyle          = FontStyles.Italic;
                }
                if (this.Txt_NouvDateAbonnement.Text != this.Txt_DateAbonnement.Text)
                {
                    this.Txt_NouvDateAbonnement.FontWeight = FontWeights.Bold;
                    this.Txt_NouvDateAbonnement.FontStyle  = FontStyles.Italic;
                }
                if (this.Txt_NouvDateResiliation.Text != this.Txt_DateResiliation.Text)
                {
                    this.Txt_NouvDateResiliation.FontWeight = FontWeights.Bold;
                    this.Txt_NouvDateResiliation.FontStyle  = FontStyles.Italic;
                }
                if (this.Txt_NouvCodePussanceSoucrite.Text != this.Txt_CodePussanceSoucrite.Text)
                {
                    this.Txt_NouvCodePussanceSoucrite.FontWeight = FontWeights.Bold;
                    this.Txt_NouvCodePussanceSoucrite.FontStyle  = FontStyles.Italic;
                }
                if (this.Txt_NouvCodePuissanceUtilise.Text != this.Txt_CodePuissanceUtilise.Text)
                {
                    this.Txt_NouvCodePuissanceUtilise.FontWeight = FontWeights.Bold;
                    this.Txt_NouvCodePuissanceUtilise.FontStyle  = FontStyles.Italic;
                }
                if (this.txt_NouvelleDebutPeriodeExo.Text != this.txt_DebutPeriodeExo.Text)
                {
                    this.txt_NouvelleDebutPeriodeExo.FontWeight = FontWeights.Bold;
                    this.txt_NouvelleDebutPeriodeExo.FontStyle  = FontStyles.Italic;
                }

                if (this.txt_NouvelleFinPeriodeExo.Text != this.txt_FinPeriodeExo.Text)
                {
                    this.txt_NouvelleFinPeriodeExo.FontWeight = FontWeights.Bold;
                    this.txt_NouvelleFinPeriodeExo.FontStyle  = FontStyles.Italic;
                }

                if (this.Txt_NouvAvanceSurConso.Text != this.Txt_AvanceSurConso.Text)
                {
                    this.Txt_NouvAvanceSurConso.FontWeight = FontWeights.Bold;
                    this.Txt_NouvAvanceSurConso.FontStyle  = FontStyles.Italic;
                }
                if (this.Txt_NouvTypeComptage.Text != this.Txt_TypeComptage.Text)
                {
                    this.Txt_NouvTypeComptage.FontWeight = FontWeights.Bold;
                    this.Txt_NouvTypeComptage.FontStyle  = FontStyles.Italic;
                }

                if (this.Txt_Categorie.Text != this.Txt_AncCodeCategorie.Text)
                {
                    this.Txt_Categorie.FontWeight = FontWeights.Bold;
                    this.Txt_Categorie.FontStyle  = FontStyles.Italic;

                    this.Txt_LibelleCategorie.FontWeight = FontWeights.Bold;
                    this.Txt_LibelleCategorie.FontStyle  = FontStyles.Italic;
                }

                if (this.chk_EstBornePoste.IsChecked != this.chk_EstBornePosteNew.IsChecked)
                {
                    this.chk_EstBornePosteNew.FontWeight = FontWeights.Bold;
                    this.chk_EstBornePosteNew.FontStyle  = FontStyles.Italic;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #17
0
        private void AfficherInfoAbonnement(CsAbon _LeAbonnementdemande)
        {
            try
            {
                if (_LeAbonnementdemande.PUISSANCE != null)
                {
                    this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCE.ToString()).ToString("N2");
                }
                if (_LeAbonnementdemande.PUISSANCEUTILISEE != null)
                {
                    this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCEUTILISEE.Value).ToString("N2");
                }
                this.Txt_CodeRistoune.Text        = string.IsNullOrEmpty(_LeAbonnementdemande.RISTOURNE.ToString()) ? string.Empty :Convert.ToDecimal(_LeAbonnementdemande.RISTOURNE.Value).ToString("N2");
                this.Txt_CodeForfait.Text         = string.IsNullOrEmpty(_LeAbonnementdemande.FORFAIT) ? string.Empty : _LeAbonnementdemande.FORFAIT;
                this.Txt_CodeTarif.Text           = string.IsNullOrEmpty(_LeAbonnementdemande.TYPETARIF) ? string.Empty : _LeAbonnementdemande.TYPETARIF;
                this.Txt_CodeFrequence.Text       = string.IsNullOrEmpty(_LeAbonnementdemande.PERFAC) ? string.Empty : _LeAbonnementdemande.PERFAC;
                this.Txt_CodeMoisIndex.Text       = string.IsNullOrEmpty(_LeAbonnementdemande.MOISREL) ? string.Empty : _LeAbonnementdemande.MOISREL;
                this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(_LeAbonnementdemande.MOISFAC) ? string.Empty : _LeAbonnementdemande.MOISFAC;
                this.Txt_DateAbonnement.Text      = (_LeAbonnementdemande.DABONNEMENT == null) ? DateTime.Now.ToShortDateString() : Convert.ToDateTime(_LeAbonnementdemande.DABONNEMENT.Value).ToShortDateString();
                this.Txt_DateResiliation.Text     = (_LeAbonnementdemande.DRES == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DRES.Value).ToShortDateString();

                if (LstForfait.Count != 0 && this.Txt_CodeForfait.Text.Length == SessionObject.Enumere.TailleForfait)
                {
                    CsForfait _LeForfait = ClasseMEthodeGenerique.RetourneObjectFromList(LstForfait, this.Txt_CodeForfait.Text, "CODE");
                    if (_LeForfait != null)
                    {
                        this.Txt_LibelleForfait.Text = _LeForfait.LIBELLE;
                        this.Txt_CodeForfait.Tag     = _LeForfait.PK_ID;
                        EnregistrerDemande(LaDemande);
                    }
                }
                if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) &&
                    LstTarif != null && LstTarif.Count != 0 &&
                    this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif)
                {
                    CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(LstTarif, this.Txt_CodeTarif.Text, "CODE");
                    if (_LeTarif != null)
                    {
                        this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE;
                        this.Txt_CodeTarif.Tag     = _LeTarif.PK_ID;
                        EnregistrerDemande(LaDemande);
                    }
                }
                if (LstFrequence.Count != 0 && this.Txt_CodeFrequence.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation)
                {
                    CsFrequence _LaFrequence = ClasseMEthodeGenerique.RetourneObjectFromList(LstFrequence, this.Txt_CodeFrequence.Text, "CODE");
                    if (_LaFrequence != null)
                    {
                        if (_LaFrequence.LIBELLE != null)
                        {
                            this.Txt_LibelleFrequence.Text = _LaFrequence.LIBELLE;
                            this.Txt_CodeFrequence.Tag     = _LaFrequence.PK_ID;
                            EnregistrerDemande(LaDemande);
                        }
                    }
                }
                if (LstMois.Count != 0 && this.Txt_CodeMoisFacturation.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation)
                {
                    CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisFacturation.Text, "CODE");
                    if (_LeMois != null)
                    {
                        if (_LeMois.LIBELLE != null)
                        {
                            this.Txt_LibMoisFact.Text        = _LeMois.LIBELLE;
                            this.Txt_CodeMoisFacturation.Tag = _LeMois.PK_ID;
                            EnregistrerDemande(LaDemande);
                        }
                    }
                }
                if (LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation)
                {
                    CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisIndex.Text, "CODE");
                    if (_LeMois != null)
                    {
                        this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE;
                        this.Txt_CodeMoisIndex.Tag     = _LeMois.PK_ID;
                        EnregistrerDemande(LaDemande);
                    }
                }
                if (LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.DimunitionPuissance ||
                    LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.AugmentationPuissance)
                {
                    Txt_CodeTarif.IsReadOnly            = true;
                    Txt_CodePuissanceUtilise.IsReadOnly = true;
                    Txt_CodeRistoune.IsReadOnly         = true;
                    Txt_CodeForfait.IsReadOnly          = true;
                    Txt_CodeFrequence.IsReadOnly        = true;
                    Txt_CodeMoisFacturation.IsReadOnly  = true;
                    Txt_CodeMoisIndex.IsReadOnly        = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }