Exemplo n.º 1
0
        public HttpResponseMessage UpdateGLDefinition(HttpRequestMessage request, [FromBody] GLDefinition glDefinitionModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var glDefinition = _CoreService.UpdateGLDefinition(glDefinitionModel);

                return request.CreateResponse <GLDefinition>(HttpStatusCode.OK, glDefinition);
            }));
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetGLDefinition(HttpRequestMessage request, int glDefinitionId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                GLDefinition glDefinition = _CoreService.GetGLDefinition(glDefinitionId);

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

                return response;
            }));
        }
Exemplo n.º 3
0
        public HttpResponseMessage DeleteGLDefinition(HttpRequestMessage request, [FromBody] int glDefinitionId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                GLDefinition glDefinition = _CoreService.GetGLDefinition(glDefinitionId);

                if (glDefinition != null)
                {
                    _CoreService.DeleteGLDefinition(glDefinitionId);

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

                return response;
            }));
        }
 public GLDefinition UpdateGLDefinition(GLDefinition glDefinition)
 {
     return(Channel.UpdateGLDefinition(glDefinition));
 }