예제 #1
0
 // 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())));
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 public string updateanthropometricTest(anthropometricTest anthropometricTest)
 {
     return(antropometricTestRepository.updateanthropometricTest(anthropometricTest));
 }
예제 #5
0
 public string insertanthropometricTest(anthropometricTest anthropometricTest)
 {
     return(antropometricTestRepository.insertanthropometricTest(anthropometricTest));
 }