Exemplo n.º 1
0
        public HttpResponseMessage UpdateCDQMTitle(HttpRequestMessage request, [FromBody] CDQMTitle cdqmTitleModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var cdqmTitle = _CDQMService.UpdateCDQMTitle(cdqmTitleModel);

                return request.CreateResponse <CDQMTitle>(HttpStatusCode.OK, cdqmTitle);
            }));
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetCDQMTitle(HttpRequestMessage request, int cdqmTitleId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                CDQMTitle cdqmTitle = _CDQMService.GetCDQMTitle(cdqmTitleId);

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

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

                // not that calling the WCF service here will authenticate access to the data
                CDQMTitle cdqmTitle = _CDQMService.GetCDQMTitle(cdqmTitleId);

                if (cdqmTitle != null)
                {
                    _CDQMService.DeleteCDQMTitle(cdqmTitleId);

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

                return response;
            }));
        }
Exemplo n.º 4
0
 public CDQMTitle UpdateCDQMTitle(CDQMTitle cdqmTitle)
 {
     return(Channel.UpdateCDQMTitle(cdqmTitle));
 }