コード例 #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 bool Insert(HUTModels.Weight model)
        {
            try
            {
                Weight weight = new Weight()
                {
                    PersonId = model.PersonId, DateEntered = model.DateEntered, WeightAmount = model.WeightAmount
                };

                repo.Create(weight);
                repo.Save();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }