public OpexVolumeBasedRate UpdateOpexVolumeBasedRate(OpexVolumeBasedRate opexVolumeBasedRate)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                IOpexVolumeBasedRateRepository opexVolumeBasedRateRepository = _DataRepositoryFactory.GetDataRepository <IOpexVolumeBasedRateRepository>();

                OpexVolumeBasedRate updatedEntity = null;

                if (opexVolumeBasedRate.OpexVolumeBasedRateId == 0)
                {
                    updatedEntity = opexVolumeBasedRateRepository.Add(opexVolumeBasedRate);
                }
                else
                {
                    updatedEntity = opexVolumeBasedRateRepository.Update(opexVolumeBasedRate);
                }

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

                IOpexVolumeBasedRateRepository opexVolumeBasedRateRepository = _DataRepositoryFactory.GetDataRepository <IOpexVolumeBasedRateRepository>();

                OpexVolumeBasedRate opexVolumeBasedRateEntity = opexVolumeBasedRateRepository.Get(opexVolumeBasedRateId);
                if (opexVolumeBasedRateEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("OpexVolumeBasedRate with ID of {0} is not in database", opexVolumeBasedRateId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return opexVolumeBasedRateEntity;
            }));
        }
Example #3
0
 public OpexVolumeBasedRate UpdateOpexVolumeBasedRate(OpexVolumeBasedRate opexVolumeBasedRate)
 {
     return(Channel.UpdateOpexVolumeBasedRate(opexVolumeBasedRate));
 }