public HttpResponseMessage UpdateBudgetingLevel(HttpRequestMessage request, [FromBody] BudgetingLevel budgetingLevelModel) { return(GetHttpResponse(request, () => { var budgetingLevel = _CoreService.UpdateBudgetingLevel(budgetingLevelModel); return request.CreateResponse <BudgetingLevel>(HttpStatusCode.OK, budgetingLevel); })); }
public HttpResponseMessage GetBudgetingLevel(HttpRequestMessage request, int budgetingLevelId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; BudgetingLevel budgetingLevel = _CoreService.GetBudgetingLevel(budgetingLevelId); // notice no need to create a seperate model object since BudgetingLevel entity will do just fine response = request.CreateResponse <BudgetingLevel>(HttpStatusCode.OK, budgetingLevel); return response; })); }
public HttpResponseMessage DeleteBudgetingLevel(HttpRequestMessage request, [FromBody] int budgetingLevelId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data BudgetingLevel budgetingLevel = _CoreService.GetBudgetingLevel(budgetingLevelId); if (budgetingLevel != null) { _CoreService.DeleteBudgetingLevel(budgetingLevelId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No budgetingLevel found under that ID."); } return response; })); }
public BudgetingLevel UpdateBudgetingLevel(BudgetingLevel budgetingLevel) { return(Channel.UpdateBudgetingLevel(budgetingLevel)); }