public bool Insert(CsPeriodiciteFacturation pEntity) { try { return(Entities.InsertEntity <Galatee.Entity.Model.PERIODICITE>(Entities.ConvertObject <Galatee.Entity.Model.PERIODICITE, CsPeriodiciteFacturation>(pEntity))); } catch (Exception ex) { throw ex; } }
private void UpdateParentList(CsPeriodiciteFacturation pParametreEvenement) { try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { GetDataNew(); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { GetDataNew(); //var ParametreEvenement = donnesDatagrid.First(p => p.PK_ID == pParametreEvenement.PK_ID); //donnesDatagrid.Remove(ParametreEvenement); //donnesDatagrid.Add(pParametreEvenement); } } catch (Exception ex) { throw ex; } }
public UcPeriodiciteFacturation(object[] pObjects, SessionObject.ExecMode [] pExecMode, DataGrid[] pGrid) { try { InitializeComponent(); Translate(); var categorieClient = new CsPeriodiciteFacturation(); if (pObjects[0] != null) { ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsPeriodiciteFacturation); } ModeExecution = pExecMode[0]; dataGrid = pGrid[0]; if (dataGrid != null) { donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsPeriodiciteFacturation>; } 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.PeriodiciteFacturation); } }
private List <CsPeriodiciteFacturation> GetInformationsFromScreen() { var listObjetForInsertOrUpdate = new List <CsPeriodiciteFacturation>(); try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { var PeriodiciteFacturation = new CsPeriodiciteFacturation { 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 == PeriodiciteFacturation.CODE) != null) { throw new Exception(Languages.CetElementExisteDeja); } listObjetForInsertOrUpdate.Add(PeriodiciteFacturation); } 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.PeriodiciteFacturation); return(null); } }