public void DeleteIFRSRegistry(int ifrsRevenueId) { ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IIFRSRegistryRepository ifrsRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRegistryRepository>(); ifrsRegistryRepository.Remove(ifrsRevenueId); }); }
public IFRSRegistryData[] GetAllIFRSRegistries() { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IIFRSRegistryRepository ifrsRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRegistryRepository>(); List <IFRSRegistryData> ifrsRegistrys = new List <IFRSRegistryData>(); IEnumerable <IFRSRegistryInfo> ifrsRegistryInfos = ifrsRegistryRepository.GetIFRSRegistrys().OrderBy(c => c.IFRSRegistry.Position).ToArray(); foreach (var ifrsRegistryInfo in ifrsRegistryInfos) { ifrsRegistrys.Add( new IFRSRegistryData { RegistryId = ifrsRegistryInfo.IFRSRegistry.EntityId, Code = ifrsRegistryInfo.IFRSRegistry.Code, Caption = ifrsRegistryInfo.IFRSRegistry.Caption, Position = ifrsRegistryInfo.IFRSRegistry.Position, RefNote = ifrsRegistryInfo.IFRSRegistry.RefNote, FinType = ifrsRegistryInfo.IFRSRegistry.FinType, FinSubType = ifrsRegistryInfo.IFRSRegistry.FinSubType, ParentId = ifrsRegistryInfo.IFRSRegistry.ParentId, ParentName = ifrsRegistryInfo.Parent != null ? ifrsRegistryInfo.Parent.Caption : string.Empty, IsTotalLine = ifrsRegistryInfo.IFRSRegistry.IsTotalLine, Color = ifrsRegistryInfo.IFRSRegistry.Color, Class = ifrsRegistryInfo.IFRSRegistry.Class, Active = ifrsRegistryInfo.IFRSRegistry.Active }); } return ifrsRegistrys.ToArray(); })); }
public IFRSRegistry GetIFRSRegistry(int ifrsRevenueId) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IIFRSRegistryRepository ifrsRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRegistryRepository>(); IFRSRegistry ifrsRegistryEntity = ifrsRegistryRepository.Get(ifrsRevenueId); if (ifrsRegistryEntity == null) { NotFoundException ex = new NotFoundException(string.Format("IFRSRegistry with ID of {0} is not in database", ifrsRevenueId)); throw new FaultException <NotFoundException>(ex, ex.Message); } return ifrsRegistryEntity; })); }