Exemplo n.º 1
0
        void ChargerTauxMini(string code)
        {
            CaisseServiceClient service = new CaisseServiceClient(Utility.Protocole(), Utility.EndPoint("Caisse"));

            service.RetourneListeTa58Completed += (s, args) =>
            {
                if (args.Error != null && args.Cancelled)
                {
                    Message.ShowError("Erreur du serveur. Réessayer svp!", Langue.errorTitle);
                    return;
                }

                if (args.Result == null)
                {
                    Message.ShowError("Echec lors de la récupération du taux minimal.Réessayer svp!", Langue.errorTitle);
                    return;
                }

                try
                {
                    Txt_NumeroDemande.IsEnabled = true;
                    CsParametresGeneraux _LeParametre = args.Result;
                    _LetauxMinimal = int.Parse(_LeParametre.LIBELLE);
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, Langue.errorTitle);
                }
            };
            service.RetourneListeTa58Async(code);
        }
Exemplo n.º 2
0
 public bool Insert(CsParametresGeneraux pParametresGeneraux)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.PARAMETRESGENERAUX>(Entities.ConvertObject <Galatee.Entity.Model.PARAMETRESGENERAUX, CsParametresGeneraux>(pParametresGeneraux)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public UcParametresGeneraux(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid)
        {
            try
            {
                InitializeComponent();
                Translate();
                var categorieClient = new CsParametresGeneraux();
                if (pObjects[0] != null)
                {
                    ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsParametresGeneraux);
                }
                ModeExecution = pExecMode[0];
                dataGrid      = pGrid[0];
                if (dataGrid != null)
                {
                    donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsParametresGeneraux>;
                }
                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_Descrition.Text = ObjetSelectionnee.DESCRIPTION;
                        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.LibelleParametresGeneraux);
            }
        }
        private List <CsParametresGeneraux> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsParametresGeneraux>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var parametresGeneraux = new CsParametresGeneraux
                    {
                        CODE         = Txt_Code.Text,
                        LIBELLE      = Txt_Libelle.Text,
                        DESCRIPTION  = Txt_Descrition.Text,
                        DATECREATION = DateTime.Now,
                        USERCREATION = UserConnecte.matricule
                    };
                    if (!string.IsNullOrEmpty(Txt_Code.Text) && donnesDatagrid.FirstOrDefault(p => p.CODE == parametresGeneraux.CODE) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(parametresGeneraux);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.CODE             = Txt_Code.Text;
                    ObjetSelectionnee.LIBELLE          = Txt_Libelle.Text;
                    ObjetSelectionnee.DESCRIPTION      = Txt_Descrition.Text;
                    ObjetSelectionnee.DATEMODIFICATION = DateTime.Now;
                    ObjetSelectionnee.USERMODIFICATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.LibelleNationalite);
                return(null);
            }
        }
 private void UpdateParentList(CsParametresGeneraux pParametresGeneraux)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             GetDataNew();
             //donnesDatagrid.Add(pParametresGeneraux);
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             GetDataNew();
             //var nationalite = donnesDatagrid.First(p => p.PK_ID == pParametresGeneraux.PK_ID);
             //donnesDatagrid.Remove(nationalite);
             //donnesDatagrid.Add(pParametresGeneraux);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }