public HttpResponseMessage UpdateKPITargetMap(HttpRequestMessage request, [FromBody] SCDKPITargetMap kpiTargetMapModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var kpiTargetMap = _ScorecardService.UpdateSCDKPITargetMap(kpiTargetMapModel);

                return request.CreateResponse <SCDKPITargetMap>(HttpStatusCode.OK, kpiTargetMap);
            }));
        }
        public HttpResponseMessage GetKPITargetMap(HttpRequestMessage request, int kpiTargetMapId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                SCDKPITargetMap kpiTargetMap = _ScorecardService.GetSCDKPITargetMap(kpiTargetMapId);

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

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

                // not that calling the WCF service here will authenticate access to the data
                SCDKPITargetMap kpiTargetMap = _ScorecardService.GetSCDKPITargetMap(kpiTargetMapId);

                if (kpiTargetMap != null)
                {
                    _ScorecardService.DeleteSCDKPITargetMap(kpiTargetMapId);

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

                return response;
            }));
        }
Ejemplo n.º 4
0
 public SCDKPITargetMap UpdateSCDKPITargetMap(SCDKPITargetMap scdKPITargetMap)
 {
     return(Channel.UpdateSCDKPITargetMap(scdKPITargetMap));
 }