Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 // 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())));
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 public string updateathleteFoda(athleteFoda athleteFoda)
 {
     return(fodaRepository.updateathleteFoda(athleteFoda));
 }
Esempio n. 5
0
 public string insertathleteFoda(athleteFoda athleteFoda)
 {
     return(fodaRepository.insertathleteFoda(athleteFoda));
 }