Ejemplo n.º 1
0
        public HttpResponseMessage UpdateGLMapping(HttpRequestMessage request, [FromBody] OpexGLMapping glMappingModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var glMapping = _MPROPEXService.UpdateOpexGLMapping(glMappingModel);

                return request.CreateResponse <OpexGLMapping>(HttpStatusCode.OK, glMapping);
            }));
        }
Ejemplo n.º 2
0
        public HttpResponseMessage GetGLMapping(HttpRequestMessage request, int glMappingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                OpexGLMapping glMapping = _MPROPEXService.GetOpexGLMapping(glMappingId);

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

                return response;
            }));
        }
Ejemplo n.º 3
0
        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
                OpexGLMapping glMapping = _MPROPEXService.GetOpexGLMapping(glMappingId);

                if (glMapping != null)
                {
                    _MPROPEXService.DeleteOpexGLMapping(glMappingId);

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

                return response;
            }));
        }
Ejemplo n.º 4
0
 public OpexGLMapping UpdateOpexGLMapping(OpexGLMapping opexGLMapping)
 {
     return(Channel.UpdateOpexGLMapping(opexGLMapping));
 }