// 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()))); } }
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); } }
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); } }
public string updateweightTestBySession(weightTestBySession weightTestBySession) { return(weightTestBySessionRepository.updateweightTestBySession(weightTestBySession)); }
public string insertweightTestBySession(weightTestBySession weightTestBySession) { return(weightTestBySessionRepository.insertweightTestBySession(weightTestBySession)); }