public string insertathleteFoda(athleteFoda athleteFoda) { try { athleteFoda.available = true; context.athleteFoda.Add(athleteFoda); context.SaveChanges(); return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
// POST: api/AthleteFodas public IHttpActionResult Post([FromBody] athleteFoda value) { try { return(ResponseMessage(Request.CreateResponse(new { response = fodaService.insertathleteFoda(value) }))); } catch (Exception e) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.ToString()))); } }
public string updateathleteFoda(athleteFoda athleteFoda) { try { var result = context.athleteFoda.FirstOrDefault(x => x.id == athleteFoda.id); if (result != null) { result.fodaItemValue = athleteFoda.fodaItemValue; result.date = athleteFoda.date; context.SaveChanges(); } return(CONSTANTES.CONSTANTES.ServiceResponse.ok); } catch (Exception e) { return(CONSTANTES.CONSTANTES.ServiceResponse.error); } }
public string updateathleteFoda(athleteFoda athleteFoda) { return(fodaRepository.updateathleteFoda(athleteFoda)); }
public string insertathleteFoda(athleteFoda athleteFoda) { return(fodaRepository.insertathleteFoda(athleteFoda)); }