public bool Insert(CsNumeroInstallation pNumeroInstallation)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.NUMEROINSTALLATION>(Entities.ConvertObject <Galatee.Entity.Model.NUMEROINSTALLATION, CsNumeroInstallation>(pNumeroInstallation)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 private void UpdateParentList(CsNumeroInstallation pNumeroInstallation)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             GetDataNew();
             //donnesDatagrid.Add(pNumeroInstallation);
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             GetDataNew();
             //var nationalite = donnesDatagrid.First(p => p.PK_ID == pNumeroInstallation.PK_ID);
             //donnesDatagrid.Remove(nationalite);
             //donnesDatagrid.Add(pNumeroInstallation);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public UcNumeroInstallation(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid)
 {
     try
     {
         InitializeComponent();
         Translate();
         var categorieClient = new CsNumeroInstallation();
         if (pObjects[0] != null)
         {
             ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsNumeroInstallation);
         }
         ModeExecution = pExecMode[0];
         dataGrid      = pGrid[0];
         if (dataGrid != null)
         {
             donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsNumeroInstallation>;
         }
         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.LibelleNumeroInstallation);
     }
 }
Ejemplo n.º 4
0
        private List <CsNumeroInstallation> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsNumeroInstallation>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var NumeroInstallation = new CsNumeroInstallation
                    {
                        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 == NumeroInstallation.CODE) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(NumeroInstallation);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.CODE         = Txt_Code.Text;
                    ObjetSelectionnee.LIBELLE      = Txt_Libelle.Text;
                    ObjetSelectionnee.DATECREATION = DateTime.Now;
                    ObjetSelectionnee.USERCREATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.LibelleNumeroInstallation);
                return(null);
            }
        }