public HttpResponseMessage UpdateExpenseRawBasis(HttpRequestMessage request, [FromBody] ExpenseRawBasis expenseRawBasisModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var expenseRawBasis = _MPROPEXService.UpdateExpenseRawBasis(expenseRawBasisModel);

                return request.CreateResponse <ExpenseRawBasis>(HttpStatusCode.OK, expenseRawBasis);
            }));
        }
        public HttpResponseMessage GetExpenseRawBasis(HttpRequestMessage request, int expenseRawBasisId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                ExpenseRawBasis expenseRawBasis = _MPROPEXService.GetExpenseRawBasis(expenseRawBasisId);

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

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

                // not that calling the WCF service here will authenticate access to the data
                ExpenseRawBasis expenseRawBasis = _MPROPEXService.GetExpenseRawBasis(expenseRawBasisId);

                if (expenseRawBasis != null)
                {
                    _MPROPEXService.DeleteExpenseRawBasis(expenseRawBasisId);

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

                return response;
            }));
        }
Exemplo n.º 4
0
 public ExpenseRawBasis UpdateExpenseRawBasis(ExpenseRawBasis expenseRawBasis)
 {
     return(Channel.UpdateExpenseRawBasis(expenseRawBasis));
 }