public HttpResponseMessage UpdateGLMapping(HttpRequestMessage request, [FromBody] RevenueGLMapping glMappingModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var glMapping = _FinstatService.UpdateRevenueGLMapping(glMappingModel);

                return request.CreateResponse <RevenueGLMapping>(HttpStatusCode.OK, glMapping);
            }));
        }
        public HttpResponseMessage GetGLMapping(HttpRequestMessage request, int glMappingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                RevenueGLMapping glMapping = _FinstatService.GetRevenueGLMapping(glMappingId);

                // notice no need to create a seperate model object since GLMapping entity will do just fine
                response = request.CreateResponse <RevenueGLMapping>(HttpStatusCode.OK, glMapping);

                return response;
            }));
        }
        public HttpResponseMessage DeleteGLMapping(HttpRequestMessage request, [FromBody] int glMappingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                RevenueGLMapping glMapping = _FinstatService.GetRevenueGLMapping(glMappingId);

                if (glMapping != null)
                {
                    _FinstatService.DeleteRevenueGLMapping(glMappingId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No glMapping found under that ID.");
                }

                return response;
            }));
        }
Exemplo n.º 4
0
 public RevenueGLMapping UpdateRevenueGLMapping(RevenueGLMapping revenueGLMapping)
 {
     return(Channel.UpdateRevenueGLMapping(revenueGLMapping));
 }