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; })); }
public HttpResponseMessage GetIFRSRevacctRegistry(HttpRequestMessage request, int revenueId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; IFRSRevacctRegistry revacctregistry = _IFRSCoreService.GetIFRSRevacctRegistry(revenueId); // notice no need to create a seperate model object since IFRSRevacctRegistry entity will do just fine response = request.CreateResponse <IFRSRevacctRegistry>(HttpStatusCode.OK, revacctregistry); return response; })); }
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; })); }
public HttpResponseMessage DeleteIFRSRevacctRegistry(HttpRequestMessage request, [FromBody] int revenueId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data IFRSRevacctRegistry revacctregistry = _IFRSCoreService.GetIFRSRevacctRegistry(revenueId); if (revacctregistry != null) { _IFRSCoreService.DeleteIFRSRevacctRegistry(revenueId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No revenue registry found under that ID."); } return response; })); }
public HttpResponseMessage UpdateIFRSRevacctRegistry(HttpRequestMessage request, [FromBody] IFRSRevacctRegistry revacctregistryModel) { return(GetHttpResponse(request, () => { var revacctregistry = _IFRSCoreService.UpdateIFRSRevacctRegistry(revacctregistryModel); return request.CreateResponse <IFRSRevacctRegistry>(HttpStatusCode.OK, revacctregistry); })); }
public IFRSRevacctRegistry UpdateIFRSRevacctRegistry(IFRSRevacctRegistry iFRSRevacctRegistry) { return(Channel.UpdateIFRSRevacctRegistry(iFRSRevacctRegistry)); }