Пример #1
0
 // POST: api/WeightTestBySession
 public IHttpActionResult Post([FromBody] weightTestBySession value)
 {
     try
     {
         return(ResponseMessage(Request.CreateResponse(new
         {
             response = weightTestBySessionService.insertweightTestBySession(value)
         })));
     }
     catch (Exception e)
     {
         return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.ToString())));
     }
 }
Пример #2
0
 public string insertweightTestBySession(weightTestBySession weightTestBySession)
 {
     try
     {
         weightTestBySession.available = true;
         context.weightTestBySession.Add(weightTestBySession);
         context.SaveChanges();
         return(CONSTANTES.CONSTANTES.ServiceResponse.ok);
     }
     catch (Exception e)
     {
         return(CONSTANTES.CONSTANTES.ServiceResponse.error);
     }
 }
Пример #3
0
 public string updateweightTestBySession(weightTestBySession weightTestBySession)
 {
     try
     {
         var result = context.weightTestBySession.FirstOrDefault(x => x.id == weightTestBySession.id);
         if (result != null)
         {
             result.sessionId    = weightTestBySession.sessionId;
             result.weightAfter  = weightTestBySession.weightAfter;
             result.weightBefore = weightTestBySession.weightBefore;
             context.SaveChanges();
         }
         return(CONSTANTES.CONSTANTES.ServiceResponse.ok);
     }
     catch (Exception e)
     {
         return(CONSTANTES.CONSTANTES.ServiceResponse.error);
     }
 }
Пример #4
0
 public string updateweightTestBySession(weightTestBySession weightTestBySession)
 {
     return(weightTestBySessionRepository.updateweightTestBySession(weightTestBySession));
 }
Пример #5
0
 public string insertweightTestBySession(weightTestBySession weightTestBySession)
 {
     return(weightTestBySessionRepository.insertweightTestBySession(weightTestBySession));
 }