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)); } }
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); } }