// POST: api/AntropometricTest public IHttpActionResult Post([FromBody] anthropometricTest value) { try { return(ResponseMessage(Request.CreateResponse(new { response = antropometricTestService.insertanthropometricTest(value) }))); } catch (Exception e) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.ToString()))); } }
public string insertanthropometricTest(anthropometricTest anthropometricTest) { try { anthropometricTest.available = true; context.anthropometricTest.Add(anthropometricTest); context.SaveChanges(); return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
public string updateanthropometricTest(anthropometricTest anthropometricTest) { try { var result = context.anthropometricTest.FirstOrDefault(x => x.id == anthropometricTest.id); if (result != null) { result.size = anthropometricTest.size; result.weight = anthropometricTest.weight; result.wingspan = anthropometricTest.wingspan; result.bodyFatPercentage = anthropometricTest.bodyFatPercentage; result.leanBodyPercentage = anthropometricTest.leanBodyPercentage; result.date = anthropometricTest.date; context.SaveChanges(); } return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
public string updateanthropometricTest(anthropometricTest anthropometricTest) { return(antropometricTestRepository.updateanthropometricTest(anthropometricTest)); }
public string insertanthropometricTest(anthropometricTest anthropometricTest) { return(antropometricTestRepository.insertanthropometricTest(anthropometricTest)); }