예제 #1
0
        public HttpResponseMessage UpdateKPIEntry(HttpRequestMessage request, [FromBody] SCDKPIEntry kpiEntryModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var kpiEntry = _ScorecardService.UpdateSCDKPIEntry(kpiEntryModel);

                return request.CreateResponse <SCDKPIEntry>(HttpStatusCode.OK, kpiEntry);
            }));
        }
예제 #2
0
        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;
            }));
        }
예제 #3
0
        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;
            }));
        }
예제 #4
0
 public SCDKPIEntry UpdateSCDKPIEntry(SCDKPIEntry scdKPIEntry)
 {
     return(Channel.UpdateSCDKPIEntry(scdKPIEntry));
 }