Ejemplo n.º 1
0
        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;
            }));
        }
Ejemplo n.º 2
0
        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);
            });
        }
Ejemplo n.º 3
0
        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();
            }));
        }
Ejemplo n.º 4
0
        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;
            }));
        }