private bool Insert(CsDenomination pDenomination) { try { return(Entities.InsertEntity <Galatee.Entity.Model.DENOMINATION>(Entities.ConvertObject <Galatee.Entity.Model.DENOMINATION, CsDenomination>(pDenomination))); } catch (Exception ex) { throw ex; } }
public bool Delete(CsDenomination pDenomination) { try { return(Entities.DeleteEntity <Galatee.Entity.Model.DENOMINATION>(Entities.ConvertObject <Galatee.Entity.Model.DENOMINATION, CsDenomination>(pDenomination))); } catch (Exception ex) { throw ex; } }
private void UpdateParentList(CsDenomination pDenomination) { try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { donnesDatagrid.Add(pDenomination); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { var Denomination = donnesDatagrid.First(p => p.PK_ID == pDenomination.PK_ID); donnesDatagrid.Remove(Denomination); donnesDatagrid.Add(pDenomination); } } catch (Exception ex) { throw ex; } }
public UcDenomination(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid) { try { InitializeComponent(); Translate(); var categorieClient = new CsDenomination(); if (pObjects[0] != null) { DenominationSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsDenomination); } ModeExecution = pExecMode[0]; dataGrid = pGrid[0]; if (dataGrid != null) { donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsDenomination>; } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification || (SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation) { if (DenominationSelectionnee != null) { Txt_Code.Text = DenominationSelectionnee.CODE; Txt_Libelle.Text = DenominationSelectionnee.LIBELLE; btnOk.IsEnabled = false; } } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation) { AllInOne.ActivateControlsFromXaml(LayoutRoot, false); } VerifierSaisie(); } catch (Exception ex) { Message.ShowError(ex.Message, Languages.LibelleDenomination); } }
private List <CsDenomination> GetInformationsFromScreen() { var listDenomination = new List <CsDenomination>(); try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { var Denomination = new CsDenomination { 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 == Denomination.CODE) != null) { throw new Exception(Languages.CetElementExisteDeja); } listDenomination.Add(Denomination); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { DenominationSelectionnee.CODE = Txt_Code.Text; DenominationSelectionnee.LIBELLE = Txt_Libelle.Text; DenominationSelectionnee.DATEMODIFICATION = DateTime.Now; DenominationSelectionnee.USERMODIFICATION = UserConnecte.matricule; listDenomination.Add(DenominationSelectionnee); } return(listDenomination); } catch (Exception ex) { Message.ShowError(ex.Message, Languages.LibelleDenomination); return(null); } }