public HttpResponseMessage UpdateKPIEntry(HttpRequestMessage request, [FromBody] SCDKPIEntry kpiEntryModel) { return(GetHttpResponse(request, () => { var kpiEntry = _ScorecardService.UpdateSCDKPIEntry(kpiEntryModel); return request.CreateResponse <SCDKPIEntry>(HttpStatusCode.OK, kpiEntry); })); }
public HttpResponseMessage GetKPIEntry(HttpRequestMessage request, int kpiEntryId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; SCDKPIEntry kpiEntry = _ScorecardService.GetSCDKPIEntry(kpiEntryId); // notice no need to create a seperate model object since KPIEntry entity will do just fine response = request.CreateResponse <SCDKPIEntry>(HttpStatusCode.OK, kpiEntry); return response; })); }
public HttpResponseMessage DeleteKPIEntry(HttpRequestMessage request, [FromBody] int kpiEntryId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SCDKPIEntry kpiEntry = _ScorecardService.GetSCDKPIEntry(kpiEntryId); if (kpiEntry != null) { _ScorecardService.DeleteSCDKPIEntry(kpiEntryId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No kpiEntry found under that ID."); } return response; })); }
public SCDKPIEntry UpdateSCDKPIEntry(SCDKPIEntry scdKPIEntry) { return(Channel.UpdateSCDKPIEntry(scdKPIEntry)); }