public HttpResponseMessage GetInstrumentTypeGLMap(HttpRequestMessage request, int instrumentTypeGLMapId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                InstrumentTypeGLMap instrumentTypeGLMap = _FinstatService.GetInstrumentTypeGLMap(instrumentTypeGLMapId);

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

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

                // not that calling the WCF service here will authenticate access to the data
                InstrumentTypeGLMap instrumentTypeGLMap = _FinstatService.GetInstrumentTypeGLMap(instrumentTypeGLMapId);

                if (instrumentTypeGLMap != null)
                {
                    _FinstatService.DeleteInstrumentTypeGLMap(instrumentTypeGLMapId);

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

                return response;
            }));
        }
示例#3
0
        //public InstrumentTypeData[] GetInstrumentTypes()
        //{
        //    return Channel.GetInstrumentTypes();
        //}

        //public InstrumentTypeData[] GetInstrumentTypeByProcess(int processId)
        //{
        //    return Channel.GetInstrumentTypeByProcess(processId);
        //}

        #endregion

        #region InstrumentTypeGLMap

        public InstrumentTypeGLMap UpdateInstrumentTypeGLMap(InstrumentTypeGLMap instrumentTypeGLMap)
        {
            return(Channel.UpdateInstrumentTypeGLMap(instrumentTypeGLMap));
        }
        public HttpResponseMessage UpdateInstrumentTypeGLMap(HttpRequestMessage request, [FromBody] InstrumentTypeGLMap instrumentTypeGLMapModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var instrumentTypeGLMap = _FinstatService.UpdateInstrumentTypeGLMap(instrumentTypeGLMapModel);

                return request.CreateResponse <InstrumentTypeGLMap>(HttpStatusCode.OK, instrumentTypeGLMap);
            }));
        }