Пример #1
0
        public HttpResponseMessage Post(HUTModels.Weight model)
        {
            WeightBLL bll = new WeightBLL();

            if (bll.Insert(model))
            {
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
            else
            {
                return(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
        }
Пример #2
0
        public IHttpActionResult GetByDateRange(int personId, DateTime startDate, DateTime endDate)
        {
            WeightBLL bll     = new WeightBLL();
            var       weights = bll.GetByDateRange(personId, startDate, endDate);

            if (weights == null)
            {
                return(Content(HttpStatusCode.NotFound, "Weights do not exist."));
            }
            else
            {
                return(Ok(weights));
            }
        }