public OpexVolumeBasedSetup UpdateOpexVolumeBasedSetup(OpexVolumeBasedSetup opexVolumeBasedSetup)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                IOpexVolumeBasedSetupRepository opexVolumeBasedSetupRepository = _DataRepositoryFactory.GetDataRepository <IOpexVolumeBasedSetupRepository>();

                OpexVolumeBasedSetup updatedEntity = null;

                if (opexVolumeBasedSetup.OpexVolumeBasedSetupId == 0)
                {
                    updatedEntity = opexVolumeBasedSetupRepository.Add(opexVolumeBasedSetup);
                }
                else
                {
                    updatedEntity = opexVolumeBasedSetupRepository.Update(opexVolumeBasedSetup);
                }

                return updatedEntity;
            }));
        }
        public OpexVolumeBasedSetup GetOpexVolumeBasedSetup(int opexVolumeBasedSetupId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                IOpexVolumeBasedSetupRepository opexVolumeBasedSetupRepository = _DataRepositoryFactory.GetDataRepository <IOpexVolumeBasedSetupRepository>();

                OpexVolumeBasedSetup opexVolumeBasedSetupEntity = opexVolumeBasedSetupRepository.Get(opexVolumeBasedSetupId);
                if (opexVolumeBasedSetupEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("OpexVolumeBasedSetup with ID of {0} is not in database", opexVolumeBasedSetupId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return opexVolumeBasedSetupEntity;
            }));
        }
예제 #3
0
 public OpexVolumeBasedSetup UpdateOpexVolumeBasedSetup(OpexVolumeBasedSetup opexVolumeBasedSetup)
 {
     return(Channel.UpdateOpexVolumeBasedSetup(opexVolumeBasedSetup));
 }