private void galatee_ModeCalcule_OkClicked(object sender, EventArgs e)
        {
            UcListeGenerique ctrs = sender as UcListeGenerique;

            if (ctrs.isOkClick)
            {
                CsModeCalcul _LeModeCalcul = (CsModeCalcul)ctrs.MyObject;
                this.Txt_CodeModeCalcule.Text = _LeModeCalcul.CODE;
            }
        }
Example #2
0
 public bool Insert(CsModeCalcul pEntity)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.MODECALCUL>(Entities.ConvertObject <Galatee.Entity.Model.MODECALCUL, CsModeCalcul>(pEntity)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void InitCentre_Redev_RechTarif_ModeCalc_ModeApp()
        {
            CsRedevance _LeRedevence = ListeRedevence.FirstOrDefault(p => p.PK_ID == this.csVariableDeTarification.FK_IDREDEVANCE);

            if (_LeRedevence != null)
            {
                this.Txt_CodeRedevence.Text    = _LeRedevence.CODE;
                this.Txt_LibelleRedevence.Text = _LeRedevence.LIBELLE;
                this.Txt_LibelleRedevence.Tag  = _LeRedevence;
            }

            CsRechercheTarif _LeRechercheTarif = ListeRechercheTarif.FirstOrDefault(p => p.PK_ID == this.csVariableDeTarification.FK_IDRECHERCHETARIF);

            if (_LeRechercheTarif != null)
            {
                this.Txt_CodeRechercheTarif.Text    = _LeRechercheTarif.CODE;
                this.Txt_LibelleRechercheTarif.Text = _LeRechercheTarif.LIBELLE;
                this.Txt_LibelleRechercheTarif.Tag  = _LeRechercheTarif;
            }

            CsModeCalcul _LeModeCalcul = ListeModeCalcule.FirstOrDefault(p => p.PK_ID == this.csVariableDeTarification.FK_IDMODECALCUL);

            if (_LeModeCalcul != null)
            {
                this.Txt_CodeModeCalcule.Text    = _LeModeCalcul.CODE;
                this.Txt_LibelleModeCalcule.Text = _LeModeCalcul.LIBELLE;
                this.Txt_LibelleModeCalcule.Tag  = _LeModeCalcul;
            }

            CsModeApplicationTarif _LeModeApp = ListeModeApplicationTarif.FirstOrDefault(p => p.PK_ID == this.csVariableDeTarification.FK_IDMODEAPPLICATION);

            if (_LeModeApp != null)
            {
                this.Txt_CodeModeApp.Text    = _LeModeApp.CODE;
                this.Txt_LibelleModeApp.Text = _LeModeApp.LIBELLE;
                this.Txt_LibelleModeApp.Tag  = _LeModeApp;
            }

            Galatee.Silverlight.ServiceAccueil.CsCentre _Lecentre = LstCentre.FirstOrDefault(p => p.PK_ID == this.csVariableDeTarification.FK_IDCENTRE);
            if (_Lecentre != null)
            {
                this.Txt_CodeCentre.Text     = _Lecentre.CODE;
                this.Txt_LibelleCentre1.Text = _Lecentre.LIBELLE;
                this.Txt_LibelleCentre1.Tag  = _Lecentre;
            }
        }
 private void Txt_CodeModeCalcule_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(Txt_CodeModeCalcule.Text) && Txt_CodeModeCalcule.Text.Length == 2)
         {
             CsModeCalcul _LeModeCalcul = ClasseMEthodeGenerique.RetourneObjectFromList(ListeModeCalcule, this.Txt_CodeModeCalcule.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeModeCalcul.LIBELLE))
             {
                 this.Txt_LibelleModeCalcule.Text = _LeModeCalcul.LIBELLE;
                 IdModeCalcul = _LeModeCalcul.PK_ID;
                 this.csVariableDeTarification.FK_IDMODECALCUL = IdModeCalcul;
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
 private void UpdateParentList(CsModeCalcul pModeCalcul)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             donnesDatagrid.Add(pModeCalcul);
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             var ModeCalcul = donnesDatagrid.First(p => p.PK_ID == pModeCalcul.PK_ID);
             donnesDatagrid.Remove(ModeCalcul);
             donnesDatagrid.Add(pModeCalcul);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public UcModeCalcul(object pObjects, SessionObject.ExecMode pExecMode, DataGrid pGrid)
        {
            try
            {
                InitializeComponent();
                Translate();
                var categorieClient = new CsModeCalcul();
                if (pObjects != null)
                {
                    ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects as CsModeCalcul);
                }
                ModeExecution = pExecMode;
                dataGrid      = pGrid;
                if (dataGrid != null)
                {
                    donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsModeCalcul>;
                }
                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;
                        btnOk.IsEnabled  = false;

                        //Txt_Code.IsReadOnly = true;
                    }
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
                {
                    AllInOne.ActivateControlsFromXaml(LayoutRoot, false);
                }
                VerifierSaisie();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.ModeCalcul);
            }
        }
        private List <CsModeCalcul> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsModeCalcul>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var ModeCalcul = new CsModeCalcul
                    {
                        CODE         = Txt_Code.Text,
                        LIBELLE      = Txt_Libelle.Text,
                        DATECREATION = DateTime.Now,
                        USERCREATION = UserConnecte.matricule
                    };
                    if (!string.IsNullOrEmpty(Txt_Code.Text) && donnesDatagrid.FirstOrDefault(p => p.CODE == ModeCalcul.CODE) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(ModeCalcul);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.CODE             = Txt_Code.Text;
                    ObjetSelectionnee.LIBELLE          = Txt_Libelle.Text;
                    ObjetSelectionnee.DATEMODIFICATION = DateTime.Now;
                    ObjetSelectionnee.USERMODIFICATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.ModeCalcul);
                return(null);
            }
        }