示例#1
0
        // Get api/InputData?Id=&Device=
        public InputData Get(DateTime Id, String DeviceId)
        {
            InputDataPersistence ip        = new InputDataPersistence();
            InputData            inputData = ip.getInputData(Id, DeviceId);

            return(inputData);
        }
示例#2
0
        // POST: api/InputData
        public HttpResponseMessage Post([FromBody] InputData inputDataValue)
        {
            InputDataPersistence ip = new InputDataPersistence();
            String date;

            date = ip.saveInputData(inputDataValue);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created);

            response.Headers.Location = new Uri(Request.RequestUri, String.Format("/{0}", date));
            return(response);
        }
示例#3
0
        // DELETE: api/InputData/5
        public HttpResponseMessage Delete(DateTime Id)
        {
            InputDataPersistence ip = new InputDataPersistence();
            bool recordExisted      = false;

            recordExisted = ip.deleteInputData(Id);
            HttpResponseMessage response;

            if (recordExisted)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }
示例#4
0
        // PUT: api/InputData/5
        public HttpResponseMessage Put(DateTime Id, [FromBody] InputData inputDataValue, String DeviceId)
        {
            InputDataPersistence ip = new InputDataPersistence();
            bool recordExisted      = false;

            recordExisted = ip.updateInputData(Id, inputDataValue, DeviceId);
            HttpResponseMessage response;

            if (recordExisted)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }
示例#5
0
        // GET: api/InputData
        public ArrayList Get()
        {
            InputDataPersistence ip = new InputDataPersistence();

            return(ip.getAllInputData());
        }