Example #1
0
 private void Txt_CodeTypeCompteur_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeTypeCompteur.Text.Length == SessionObject.Enumere.TailleCodeTypeCompteur && (LstTypeCompteur != null && LstTypeCompteur.Count != 0))
         {
             CsTcompteur _LeTypeCompte = ClasseMEthodeGenerique.RetourneObjectFromList(LstTypeCompteur.Where(n => n.PRODUIT == CodeProduit).ToList(), this.Txt_CodeTypeCompteur.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeTypeCompte.LIBELLE))
             {
                 this.Txt_LibelleTypeClient.Text = _LeTypeCompte.LIBELLE;
                 this.Txt_CodeTypeCompteur.Tag   = _LeTypeCompte.PK_ID;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeTypeCompteur.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
Example #2
0
 public UcDemandeSaisieCompteurMt(CsDemande _LaDemande, CsTcompteur _LeCompteurSelect)
 {
     InitializeComponent();
     ChargerCadran();
     ChargerMarque();
     LeCompteurSelect = _LeCompteurSelect;
     LaDemande        = _LaDemande;
 }
Example #3
0
 public bool Insert(CsTcompteur pTcompt)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.TYPECOMPTEUR>(Entities.ConvertObject <Galatee.Entity.Model.TYPECOMPTEUR, CsTcompteur>(pTcompt)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        void ChargerTypeCompteur()
        {
            LstTypeCompteur = new List <CsTcompteur>();

            if (SessionObject.LstTypeCompteur.Count != 0)
            {
                if (TypeDemande == SessionObject.Enumere.ModificationCompteur)
                {
                    LstTypeCompteur = SessionObject.LstTypeCompteur;
                }
                else
                {
                    LstTypeCompteur = SessionObject.LstTypeCompteur.Where(p => p.PRODUIT == LaDemande.LaDemande.PRODUIT).ToList();
                }
                if (LstTypeCompteur.Count != 0)
                {
                    if (!string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) &&
                        (string.IsNullOrEmpty(this.Txt_LibelleTypeCompteur.Text)))
                    {
                        CsTcompteur _LeType = ClasseMEthodeGenerique.RetourneObjectFromList(LstTypeCompteur, this.Txt_CodeTypeCompteur.Text, "CODE");
                        if (_LeType != null && !string.IsNullOrEmpty(_LeType.LIBELLE))
                        {
                            this.Txt_LibelleTypeCompteur.Text = _LeType.LIBELLE;
                        }
                    }
                }
            }
            else
            {
                AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.ChargerTypeCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    LstTypeCompteur = args.Result;
                    if (LstTypeCompteur != null && LstTypeCompteur.Count != 0)
                    {
                        if (!string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) &&
                            (string.IsNullOrEmpty(this.Txt_LibelleTypeCompteur.Text)))
                        {
                            CsTcompteur _LeType = ClasseMEthodeGenerique.RetourneObjectFromList(LstTypeCompteur, this.Txt_CodeTypeCompteur.Text, "CODE");
                            if (_LeType != null && !string.IsNullOrEmpty(_LeType.LIBELLE))
                            {
                                this.Txt_LibelleTypeCompteur.Text = _LeType.LIBELLE;
                            }
                        }
                    }
                };
                service.ChargerTypeAsync();
                service.CloseAsync();
            }
        }
 void galatee_OkClickedbtntypeCompteur(object sender, EventArgs e)
 {
     try
     {
         UcListeGenerique ctrs = sender as UcListeGenerique;
         if (ctrs.GetisOkClick)
         {
             CsTcompteur _LeTypeCompteur = (CsTcompteur)ctrs.MyObject;
             this.Txt_CodeTypeCompteur.Text = _LeTypeCompteur.CODE;
         }
         this.btn_typeCompteur.IsEnabled = true;
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
        void AfficherCannalisationDemande(CsCanalisation LaCanalisation, CsEvenement LeEvt)
        {
            CsEvenement _LeEvt = new CsEvenement();

            if ((LaDemande.LeTypeDemande.CODE == SessionObject.Enumere.ChangementCompteur && NumCompteur == 1) || LaDemande.LeTypeDemande.CODE != SessionObject.Enumere.ChangementCompteur)
            {
                this.Txt_NumCompteur.Text = (string.IsNullOrEmpty(LaCanalisation.NUMERO)) ? string.Empty : LaCanalisation.NUMERO;
                this.Txt_AnneeFab.Text    = (string.IsNullOrEmpty(LaCanalisation.ANNEEFAB)) ? string.Empty : LaCanalisation.ANNEEFAB;

                this.Txt_CodeTypeCompteur.Text = (string.IsNullOrEmpty(LaCanalisation.TYPECOMPTEUR)) ? string.Empty : LaCanalisation.TYPECOMPTEUR;
                CsTcompteur _LeTypeCompte = ClasseMEthodeGenerique.RetourneObjectFromList(LstTypeCompteur, this.Txt_CodeTypeCompteur.Text, "CODE");
                if (!string.IsNullOrEmpty(_LeTypeCompte.LIBELLE))
                {
                    LeTypeCompteurSelect = _LeTypeCompte;
                    this.Txt_LibelleTypeCompteur.Text = _LeTypeCompte.LIBELLE;
                }

                this.Txt_CodeMarque.Text = (string.IsNullOrEmpty(LaCanalisation.MARQUE)) ? string.Empty : LaCanalisation.MARQUE;
                CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_CodeMarque.Text, "CODE");
                if (!string.IsNullOrEmpty(_LaMarque.LIBELLE))
                {
                    this.Txt_LibelleMarque.Text = _LaMarque.LIBELLE;
                }

                this.Txt_CodeCadran.Text = LaCanalisation.CADRAN.Value.ToString();
                CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CodeCadran.Text, "CODECADRAN");
                if (!string.IsNullOrEmpty(_LeCadran.LIBELLE))
                {
                    this.Txt_LibelleDigit.Text = _LeCadran.LIBELLE;
                    LeCadranSelect             = _LeCadran;
                }

                this.Txt_CodeDiametre.Text = (string.IsNullOrEmpty(LaCanalisation.DIAMETRE)) ? string.Empty : LaCanalisation.DIAMETRE;
                CsDiacomp _LeDiametre = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE");
                if (!string.IsNullOrEmpty(_LeDiametre.LIBELLE))
                {
                    LeDiametreSelect = _LeDiametre;
                    this.Txt_LibelleDiametre.Text = _LeDiametre.LIBELLE;
                }

                if (LaCanalisation.COEFLECT != 0)
                {
                    this.Chk_CoefMultiplication.IsChecked = true;
                }
            }
        }
        void ctrl_Closed(object sender, EventArgs e)
        {
            UcDemandeSaisieCompteurMt ctr = sender as UcDemandeSaisieCompteurMt;
            CsTcompteur leCompteur        = ctr.EnregisterCompteur();

            CsTcompteur leCompeteurSelect = LstType.FirstOrDefault(t => t.POINT == leCompteur.POINT);

            if (leCompeteurSelect != null)
            {
                LeCompteurSelect.ANNEEFAB = leCompteur.ANNEEFAB;
                LeCompteurSelect.CADCOMP  = leCompteur.CADCOMP;
                LeCompteurSelect.COMPTEUR = leCompteur.COMPTEUR;
                LeCompteurSelect.MCOMPT   = leCompteur.MCOMPT;
                LeCompteurSelect.SAISIE   = "OUI";
            }
            dataGrid1.ItemsSource = null;
            dataGrid1.ItemsSource = LstType;
        }
        void _ctrl_Closed(object sender, EventArgs e)
        {
            UcLiasonCompteur   ctr = sender as UcLiasonCompteur;
            List <CsCompteur>  _LeCompteurSelectDatagrid = new List <CsCompteur>();
            List <CsTcompteur> _LeCompteurSelect         = new List <CsTcompteur>();



            _LeCompteurSelectDatagrid = (List <CsCompteur>)ctr.dgDemande.SelectedItem;
            foreach (CsCompteur cpt in _LeCompteurSelectDatagrid)
            {
                CsTcompteur cp = new CsTcompteur()
                {
                    PK_ID    = cpt.PK_ID,
                    COMPTEUR = cpt.NUMERO,
                    MCOMPT   = cpt.MARQUE,
                    SAISIE   = "Oui"
                };
                _LeCompteurSelect.Add(cp);
            }
        }
        void _ctrl_Closed(object sender, EventArgs e)
        {
            //UcListeCompteurAuto ctr = sender as UcListeCompteurAuto;
            CsCompteur  _LeCompteurSelectDatagrid = new CsCompteur();
            CsTcompteur _LeCompteurSelect         = new CsTcompteur();


            //_LeCompteurSelectDatagrid = (CsCompteur)ctr.dataGrid1.SelectedItem;
            LeCompteurSelect.COMPTEUR = _LeCompteurSelectDatagrid.NUMERO;
            LeCompteurSelect.MCOMPT   = _LeCompteurSelectDatagrid.MARQUE;
            //LeCompteurSelect.TCOMP = _LeCompteurSelectDatagrid.TCOMPT;
            LeCompteurSelect.ANNEEFAB = _LeCompteurSelectDatagrid.ANNEEFAB;
            LeCompteurSelect.POINT    = determinePoint(LeCompteurSelect.TCOMP);
            LeCompteurSelect.SAISIE   = "Oui";

            //Inserer canalisation
            CsCanalisation _LeCanalisation = new CsCanalisation();
            //_LeCanalisation.CENTRE = LaDemande.CENTRE;
            //_LeCanalisation.CLIENT = LaDemande.CLIENT;
            //_LeCanalisation.ORDRE = LaDemande.ORDRE;
            //_LeCanalisation.POINT = LaDemande.POINT;
            //_LeCanalisation.ANNEEFAB = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.ANNEEFAB) ? string.Empty : _LeCompteurSelectDatagrid.ANNEEFAB;
            //_LeCanalisation.MCOMPT = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.MCOMPT) ? string.Empty : _LeCompteurSelectDatagrid.MCOMPT;
            //_LeCanalisation.COMPTEUR = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.COMPTEUR) ? string.Empty : _LeCompteurSelectDatagrid.COMPTEUR ;
            //_LeCanalisation.CADCOMPT = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.CADCOMP) ? string.Empty : _LeCompteurSelectDatagrid.CADCOMP;
            //_LeCanalisation.TCOMPT = LeCompteurSelect.PK_TYPE ;
            //if (LaDemande.TYPEDEMANDE == SessionObject.Enumere.AbonnementSeul ||
            //    LaDemande.TYPEDEMANDE == SessionObject.Enumere.BranchementAbonement)
            //    _LeCanalisation.ETATCOMPT = SessionObject.Enumere.CompteurActifValeur;

            //if (!string.IsNullOrEmpty(_LeCanalisation.COMPTEUR))
            //{
            //    if (LstCanalisation.FirstOrDefault(p=>p.TCOMPT  == _LeCanalisation.TCOMPT  )==null )
            //    LstCanalisation.Add(_LeCanalisation);
            //}
            UcDemandeSaisieCompteurMt ctrl = new UcDemandeSaisieCompteurMt(LaDemande, LeCompteurSelect);

            ctrl.Closed += new EventHandler(ctrl_Closed);
            ctrl.Show();
        }
Example #10
0
        public CsTcompteur  EnregisterCompteur()
        {
            try
            {
                CsCanalisation _LeCompteur = new CsCanalisation();
                _LeCompteur.CENTRE           = LaDemande.LaDemande.CENTRE;
                _LeCompteur.CLIENT           = LaDemande.LaDemande.CLIENT;
                _LeCompteur.PRODUIT          = LaDemande.LaDemande.PRODUIT;
                _LeCompteur.NUMDEM           = LaDemande.LaDemande.NUMDEM;
                _LeCompteur.POINT            = int.Parse(LeCompteurSelect.POINT.ToString());
                _LeCompteur.TYPECOMPTEUR     = LeCompteurSelect.CODE;
                _LeCompteur.TYPECOMPTAGE     = LaDemande.Branchement.TYPECOMPTAGE;
                _LeCompteur.NUMERO           = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text;
                _LeCompteur.ANNEEFAB         = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text;
                _LeCompteur.MARQUE           = string.IsNullOrEmpty(this.Txt_MarqueCompteur.Text) ? string.Empty : this.Txt_MarqueCompteur.Text;
                _LeCompteur.CADRAN           = System.Convert.ToByte(Txt_CadranCompteur.Text);
                _LeCompteur.USERCREATION     = UserConnecte.matricule;
                _LeCompteur.USERMODIFICATION = UserConnecte.matricule;
                _LeCompteur.DATECREATION     = System.DateTime.Now;
                _LeCompteur.DATEMODIFICATION = System.DateTime.Now;

                CsEvenement _LeEvt    = new CsEvenement();
                int?        _AncIndex = _LeEvt.INDEXEVT;
                _LeEvt.NUMDEM            = LaDemande.LaDemande.NUMDEM;
                _LeEvt.CENTRE            = LaDemande.LaDemande.CENTRE;
                _LeEvt.CLIENT            = LaDemande.LaDemande.CLIENT;
                _LeEvt.ORDRE             = LaDemande.LaDemande.ORDRE;
                _LeEvt.PRODUIT           = LaDemande.LaDemande.PRODUIT;
                _LeEvt.DIAMETRE          = _LeCompteur.DIAMETRE;
                _LeEvt.TYPECOMPTEUR      = _LeCompteur.TYPECOMPTEUR;
                _LeCompteur.TYPECOMPTAGE = LaDemande.Branchement.TYPECOMPTAGE;
                _LeEvt.COMPTEUR          = _LeCompteur.NUMERO;
                _LeEvt.POINT             = _LeCompteur.POINT;
                _LeEvt.IDCANALISATION    = _LeCompteur.PK_ID;
                _LeEvt.MATRICULE         = LaDemande.LaDemande.MATRICULE;
                _LeEvt.INDEXEVT          = null;
                if (!string.IsNullOrEmpty(this.Txt_Index.Text))
                {
                    _LeEvt.INDEXEVT = int.Parse(this.Txt_Index.Text);
                }

                if (LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.ChangementCompteur ||
                    LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.FermetureBrt ||
                    LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.DeposeCompteur)
                {
                    _LeEvt.CAS = SessionObject.Enumere.CasDeposeCompteur;
                }
                else
                {
                    _LeEvt.CAS = SessionObject.Enumere.CasPoseCompteur;
                }

                _LeEvt.CODEEVT = SessionObject.Enumere.EvenementCodeNormale;
                _LeEvt.STATUS  = SessionObject.Enumere.EvenementCree;

                _LeEvt.USERCREATION     = UserConnecte.matricule;
                _LeEvt.USERMODIFICATION = UserConnecte.matricule;
                _LeEvt.DATECREATION     = System.DateTime.Now;
                _LeEvt.DATEMODIFICATION = System.DateTime.Now;


                if (LaDemande.LstCanalistion != null && LaDemande.LstCanalistion.Count != 0)
                {
                    CsCanalisation _LaCan = LaDemande.LstCanalistion.FirstOrDefault(p => p.POINT == _LeCompteur.POINT);
                    if (_LaCan != null)
                    {
                        LaDemande.LstCanalistion.Remove(_LaCan);
                    }
                    LaDemande.LstCanalistion.Add(_LeCompteur);
                }
                else
                {
                    LaDemande.LstCanalistion.Add(_LeCompteur);
                }

                if (LaDemande.LstEvenement != null && LaDemande.LstEvenement.Count != 0)
                {
                    CsEvenement _LeEvtR = LaDemande.LstEvenement.FirstOrDefault(p => p.POINT == _LeCompteur.POINT);
                    if (_LeEvtR != null)
                    {
                        LaDemande.LstEvenement.Remove(_LeEvtR);
                    }
                    LaDemande.LstEvenement.Add(_LeEvt);
                }
                else
                {
                    LaDemande.LstEvenement.Add(_LeEvt);
                }


                CsTcompteur leCompteur = new CsTcompteur()
                {
                    POINT    = int.Parse(LeCompteurSelect.POINT.ToString()),
                    COMPTEUR = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text,
                    ANNEEFAB = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text,
                    MCOMPT   = string.IsNullOrEmpty(this.Txt_MarqueCompteur.Text) ? string.Empty : this.Txt_MarqueCompteur.Text,
                    CADCOMP  = string.IsNullOrEmpty(this.Txt_CadranCompteur.Text) ? string.Empty : this.Txt_CadranCompteur.Text
                };
                return(leCompteur);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
 private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     LeCompteurSelect = new CsTcompteur();
     LeCompteurSelect = this.dataGrid1.SelectedItem as CsTcompteur;
 }