Esempio n. 1
0
        public HttpResponseMessage GetOpexManagementTree(HttpRequestMessage request, int opexmgtTreeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                OpexManagementTree opexManagementTree = _MPROPEXService.GetOpexManagementTree(opexmgtTreeId);

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

                return response;
            }));
        }
Esempio n. 2
0
        public HttpResponseMessage DeleteOpexManagementTree(HttpRequestMessage request, [FromBody] int opexmgtTreeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                OpexManagementTree opexManagementTree = _MPROPEXService.GetOpexManagementTree(opexmgtTreeId);

                if (opexManagementTree != null)
                {
                    _MPROPEXService.DeleteOpexManagementTree(opexmgtTreeId);

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

                return response;
            }));
        }
Esempio n. 3
0
        public HttpResponseMessage UpdateOpexManagementTree(HttpRequestMessage request, [FromBody] OpexManagementTree opexManagementTreeModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var opexManagementTree = _MPROPEXService.UpdateOpexManagementTree(opexManagementTreeModel);

                return request.CreateResponse <OpexManagementTree>(HttpStatusCode.OK, opexManagementTree);
            }));
        }
Esempio n. 4
0
 public OpexManagementTree UpdateOpexManagementTree(OpexManagementTree opexManagementTree)
 {
     return(Channel.UpdateOpexManagementTree(opexManagementTree));
 }