// POST: api/StrengthTest public IHttpActionResult Post([FromBody] strengthTest value) { try { return(ResponseMessage(Request.CreateResponse(new { response = strengthTestService.insertstrengthTest(value) }))); } catch (Exception e) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.ToString()))); } }
public string insertstrengthTest(strengthTest strengthTest) { try { strengthTest.available = true; context.strengthTest.Add(strengthTest); context.SaveChanges(); return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
public string updatestrengthTest(strengthTest strengthTest) { try { var result = context.strengthTest.FirstOrDefault(x => x.id == strengthTest.id); if (result != null) { result.maxRepetitionWeightValue = strengthTest.maxRepetitionWeightValue; result.strengthTestTypeId = strengthTest.strengthTestTypeId; result.date = strengthTest.date; context.SaveChanges(); } return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
public string updatestrengthTest(strengthTest strengthTest) { return(strengthTestRepository.updatestrengthTest(strengthTest)); }
public string insertstrengthTest(strengthTest strengthTest) { return(strengthTestRepository.insertstrengthTest(strengthTest)); }