public DerivedCaption UpdateDerivedCaption(DerivedCaption derivedCaption) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); DerivedCaption updatedEntity = null; if (derivedCaption.DerivedCaptionId == 0) { updatedEntity = derivedCaptionRepository.Add(derivedCaption); } else { updatedEntity = derivedCaptionRepository.Update(derivedCaption); } return updatedEntity; })); }
public void DeleteDerivedCaption(int derivedCaptionId) { ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); derivedCaptionRepository.Remove(derivedCaptionId); }); }
public DerivedCaption[] GetAllDerivedCaptions() { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); IEnumerable <DerivedCaption> derivedCaptions = derivedCaptionRepository.Get().ToArray(); return derivedCaptions.ToArray(); })); }
public DerivedCaption GetDerivedCaption(int derivedCaptionId) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); DerivedCaption derivedCaptionEntity = derivedCaptionRepository.Get(derivedCaptionId); if (derivedCaptionEntity == null) { NotFoundException ex = new NotFoundException(string.Format("DerivedCaption with ID of {0} is not in database", derivedCaptionId)); throw new FaultException <NotFoundException>(ex, ex.Message); } return derivedCaptionEntity; })); }