Ejemplo n.º 1
0
        public IFRSRevacctRegistry UpdateIFRSRevacctRegistry(IFRSRevacctRegistry IFRSRevacctRegistry)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR
                };
                AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames);

                IIFRSRevacctRegistryRepository IFRSRevacctRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRevacctRegistryRepository>();

                IFRSRevacctRegistry updatedEntity = null;

                if (IFRSRevacctRegistry.RevenueId == 0)
                {
                    updatedEntity = IFRSRevacctRegistryRepository.Add(IFRSRevacctRegistry);
                }
                else
                {
                    updatedEntity = IFRSRevacctRegistryRepository.Update(IFRSRevacctRegistry);
                }

                return updatedEntity;
            }));
        }
Ejemplo n.º 2
0
        public void DeleteIFRSRevacctRegistry(int IFRSRevacctRevenueId)
        {
            ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR
                };
                AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames);

                IIFRSRevacctRegistryRepository IFRSRevacctRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRevacctRegistryRepository>();

                IFRSRevacctRegistryRepository.Remove(IFRSRevacctRevenueId);
            });
        }
Ejemplo n.º 3
0
        public IFRSRevacctRegistryData[] GetAllIFRSRevacctRegistries()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER
                };
                AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames);

                IIFRSRevacctRegistryRepository ifrsRevacctRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRevacctRegistryRepository>();


                List <IFRSRevacctRegistryData> ifrsRevacctRegistries = new List <IFRSRevacctRegistryData>();
                IEnumerable <IFRSRevacctRegistryInfo> ifrsRevacctRegistryInfos = ifrsRevacctRegistryRepository.GetIFRSRevacctRegistries().OrderBy(c => c.IFRSRevacctRegistry.Position).ToArray();

                foreach (var ifrsRevacctRegistryInfo in ifrsRevacctRegistryInfos)
                {
                    ifrsRevacctRegistries.Add(
                        new IFRSRevacctRegistryData
                    {
                        RevenueId = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.EntityId,
                        Code = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Code,
                        Caption = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Caption,
                        Position = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Position,
                        RefNote = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.RefNote,
                        FinType = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.FinType,
                        FinSubType = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.FinSubType,
                        ParentId = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.ParentId,
                        ParentName = ifrsRevacctRegistryInfo.Parent != null ? ifrsRevacctRegistryInfo.Parent.Caption : string.Empty,
                        IsTotalLine = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.IsTotalLine,
                        Color = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Color,
                        Class = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Class,
                        Active = ifrsRevacctRegistryInfo.IFRSRevacctRegistry.Active
                    });
                }

                return ifrsRevacctRegistries.ToArray();
            }));
        }
Ejemplo n.º 4
0
        public IFRSRevacctRegistry GetIFRSRevacctRegistry(int IFRSRevacctRevenueId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER
                };
                AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames);

                IIFRSRevacctRegistryRepository IFRSRevacctRegistryRepository = _DataRepositoryFactory.GetDataRepository <IIFRSRevacctRegistryRepository>();

                IFRSRevacctRegistry IFRSRevacctRegistryEntity = IFRSRevacctRegistryRepository.Get(IFRSRevacctRevenueId);
                if (IFRSRevacctRegistryEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("IFRSRevacctRegistry with ID of {0} is not in database", IFRSRevacctRevenueId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return IFRSRevacctRegistryEntity;
            }));
        }