コード例 #1
0
 private void Txt_CodeMarque_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeMarque.Text.Length == SessionObject.Enumere.TailleCodeMarqueCompteur && (LstMarque != null && LstMarque.Count != 0))
         {
             CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_CodeMarque.Text, "CODE");
             if (!string.IsNullOrEmpty(_LaMarque.LIBELLE))
             {
                 this.Txt_LibelleMarque.Text = _LaMarque.LIBELLE;
                 this.Txt_CodeMarque.Tag     = _LaMarque.PK_ID;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeMarque.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
コード例 #2
0
 void ChargerMarque()
 {
     try
     {
         AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.RetourneToutMarqueCompleted += (s, args) =>
         {
             LstMarque = new List <CsMarqueCompteur>();
             if (args != null && args.Cancelled)
             {
                 return;
             }
             LstMarque = args.Result;
             if (LstMarque != null && LstMarque.Count != 0)
             {
                 if (!string.IsNullOrEmpty(this.Txt_MarqueCompteur.Text) &&
                     (!string.IsNullOrEmpty(this.Txt_LibelleMarque.Text)))
                 {
                     CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_MarqueCompteur.Text, "PK_MARQUECOMPTEUR");
                     if (string.IsNullOrEmpty(_LaMarque.LIBELLE))
                     {
                         this.Txt_MarqueCompteur.Text = _LaMarque.LIBELLE;
                     }
                 }
             }
         };
         service.RetourneToutMarqueAsync();
         service.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
 public bool Insert(CsMarqueCompteur pMarqueCompteur)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.MARQUECOMPTEUR>(Entities.ConvertObject <Galatee.Entity.Model.MARQUECOMPTEUR, CsMarqueCompteur>(pMarqueCompteur)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        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;
                }
            }
        }
コード例 #5
0
 private void UpdateParentList(CsMarqueCompteur pMarque)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             GetDataNew();
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             GetDataNew();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
 void galatee_OkClickedbtn_Marque(object sender, EventArgs e)
 {
     try
     {
         this.btn_Marque.IsEnabled = true;
         UcListeGenerique ctrs = sender as UcListeGenerique;
         if (ctrs.isOkClick)
         {
             CsMarqueCompteur _LaMarque = (CsMarqueCompteur)ctrs.MyObject;
             this.Txt_CodeMarque.Text = _LaMarque.CODE;
             this.Txt_CodeMarque.Tag  = _LaMarque.PK_ID;
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
コード例 #7
0
 public UcMarqueCompteur(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid)
 {
     try
     {
         InitializeComponent();
         Translate();
         var marque = new CsMarqueCompteur();
         if (pObjects[0] != null)
         {
             ObjetSelectionnee = Utility.ParseObject(marque, pObjects[0] as CsMarqueCompteur);
         }
         ModeExecution = pExecMode[0];
         dataGrid      = pGrid[0];
         if (dataGrid != null)
         {
             donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsMarqueCompteur>;
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification ||
             (SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
         {
             if (ObjetSelectionnee != null)
             {
                 Txt_Code.Text        = ObjetSelectionnee.CODE;
                 Txt_Libelle.Text     = ObjetSelectionnee.LIBELLE;
                 Txt_Coefficient.Text = ObjetSelectionnee.COEFFICIENTDEMULTIPLICATION.ToString();
                 btnOk.IsEnabled      = false;
             }
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
         {
             AllInOne.ActivateControlsFromXaml(LayoutRoot, false);
         }
         VerifierSaisie();
     }
     catch (Exception ex)
     {
         Message.Show(ex.Message, "Marque compteur");
     }
 }
コード例 #8
0
        private List <CsMarqueCompteur> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsMarqueCompteur>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var Marque = new CsMarqueCompteur
                    {
                        CODE    = Txt_Code.Text,
                        LIBELLE = Txt_Libelle.Text,
                        COEFFICIENTDEMULTIPLICATION = int.Parse(Txt_Coefficient.Text),
                        DATECREATION = DateTime.Now,
                        USERCREATION = UserConnecte.matricule
                    };
                    if (!string.IsNullOrEmpty(Txt_Code.Text) && donnesDatagrid.FirstOrDefault(p => p.CODE == Marque.CODE) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(Marque);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.CODE    = Txt_Code.Text;
                    ObjetSelectionnee.LIBELLE = Txt_Libelle.Text;
                    ObjetSelectionnee.COEFFICIENTDEMULTIPLICATION = int.Parse(Txt_Coefficient.Text);
                    ObjetSelectionnee.DATECREATION = DateTime.Now;
                    ObjetSelectionnee.USERCREATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }