public HttpResponseMessage GetOpexBranchMapping(HttpRequestMessage request, int opexBranchMappingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                OpexBranchMapping opexBranchMapping = _MPROPEXService.GetOpexBranchMapping(opexBranchMappingId);

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

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

                // not that calling the WCF service here will authenticate access to the data
                OpexBranchMapping opexBranchMapping = _MPROPEXService.GetOpexBranchMapping(opexBranchMappingId);

                if (opexBranchMapping != null)
                {
                    _MPROPEXService.DeleteOpexBranchMapping(opexBranchMappingId);

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

                return response;
            }));
        }
        public HttpResponseMessage UpdateOpexBranchMapping(HttpRequestMessage request, [FromBody] OpexBranchMapping opexBranchMappingModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var opexBranchMapping = _MPROPEXService.UpdateOpexBranchMapping(opexBranchMappingModel);

                return request.CreateResponse <OpexBranchMapping>(HttpStatusCode.OK, opexBranchMapping);
            }));
        }
 public OpexBranchMapping UpdateOpexBranchMapping(OpexBranchMapping opexBranchMapping)
 {
     return(Channel.UpdateOpexBranchMapping(opexBranchMapping));
 }