Exemple #1
0
 public string insertresistanceTest(resistanceTest resistanceTest)
 {
     try
     {
         resistanceTest.available = true;
         context.resistanceTest.Add(resistanceTest);
         context.SaveChanges();
         return(CONSTANTES.CONSTANTES.ServiceResponse.ok);
     }
     catch (Exception e)
     {
         return(CONSTANTES.CONSTANTES.ServiceResponse.error);
     }
 }
Exemple #2
0
 // POST: api/ResistanceTest
 public IHttpActionResult Post([FromBody] resistanceTest value)
 {
     try
     {
         return(ResponseMessage(Request.CreateResponse(new
         {
             response = resistanceTestService.insertresistanceTest(value)
         })));
     }
     catch (Exception e)
     {
         return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.ToString())));
     }
 }
Exemple #3
0
 public string updateresistanceTest(resistanceTest resistanceTest)
 {
     try
     {
         var result = context.resistanceTest.FirstOrDefault(x => x.id == resistanceTest.id);
         if (result != null)
         {
             result.hours        = resistanceTest.hours;
             result.minutes      = resistanceTest.minutes;
             result.seconds      = resistanceTest.seconds;
             result.milliseconds = resistanceTest.milliseconds;
             result.meters       = resistanceTest.meters;
             context.SaveChanges();
         }
         return(CONSTANTES.CONSTANTES.ServiceResponse.ok);
     }
     catch (Exception e)
     {
         return(CONSTANTES.CONSTANTES.ServiceResponse.error);
     }
 }
 public string updateresistanceTest(resistanceTest resistanceTest)
 {
     return(resistanceTestRepository.updateresistanceTest(resistanceTest));
 }
 public string insertresistanceTest(resistanceTest resistanceTest)
 {
     return(resistanceTestRepository.insertresistanceTest(resistanceTest));
 }