public IHttpActionResult Post(HUTModels.CalorieCountOffDay model)
        {
            CalorieCountOffDayBLL bll = new CalorieCountOffDayBLL();

            if (bll.Insert(model))
            {
                return(Ok(model));
            }
            else
            {
                return(Content(HttpStatusCode.InternalServerError, "Problem inserting calorie count day off entry."));
            }
        }
Ejemplo n.º 2
0
        public bool Insert(HUTModels.CalorieCountOffDay model)
        {
            try
            {
                CalorieCountOffDay countOffDay = new CalorieCountOffDay()
                {
                    PersonId = model.PersonId, DateEntered = model.DateEntered
                };

                repo.Create(countOffDay);
                repo.Save();

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