Ejemplo n.º 1
0
 public IActionResult EditAthleteEnrollsChallenge([FromBody] AthleteEnrollsChallenge challengeEnrollment)
 {
     if (ModelState.IsValid)
     {
         _dataAccessProvider.UpdateChallengeEnrollmentRecord(challengeEnrollment);
         return(Ok());
     }
     return(BadRequest());
 }
Ejemplo n.º 2
0
 public IActionResult CreateChallengeEnrollment([FromBody] AthleteEnrollsChallenge challengeEnrollment, string token)
 {
     if (ModelState.IsValid)
     {
         _dataAccessProvider.AddChallengeEnrollmentRecord(challengeEnrollment, token);
         return(Ok());
     }
     return(BadRequest());
 }
Ejemplo n.º 3
0
 /*
  * Description:Updates an enrollment in AthleteEnrollsChallenge table
  * Params:Object Race
  * Output:None
  */
 public void UpdateChallengeEnrollmentRecord(AthleteEnrollsChallenge challengeEnrollment)
 {
     _context.athleteenrollschallenges.Update(challengeEnrollment);
     _context.SaveChanges();
 }
Ejemplo n.º 4
0
 /*
  * Description:Adds a race to AthleteEnrollsChallenge table
  * Params:Object Race
  * Output:None
  */
 public void AddChallengeEnrollmentRecord(AthleteEnrollsChallenge challengeEnrollment, string token)
 {
     challengeEnrollment.id_athlete = _context.onlineusers.Where(ou => ou.token == token).Select(a => a.id_athlete_fk).SingleOrDefault();
     _context.athleteenrollschallenges.Add(challengeEnrollment);
     _context.SaveChanges();
 }