Example #1
0
 public IActionResult Post([FromBody] Attendee attendeeToAdd)
 {
     if (_ahcmsContext.Attendees.Where(a => a.AttendeeRFID == attendeeToAdd.AttendeeRFID).Any())
     {
         return(ValidationProblem("RFID already registered"));
     }
     else
     {
         _ahcmsContext.Attendees.Add(attendeeToAdd);
         _ahcmsContext.SaveChanges();
         return(Ok("Registration successful"));
     }
 }
Example #2
0
 public ActionResult Register([FromBody] AppUser registerAppUser)
 {
     if (_ahcmsContext.AppUsers.Where(a => a.Username == registerAppUser.Username).Any())
     {
         return(Conflict("Username already registered"));
     }
     else
     {
         _ahcmsContext.AppUsers.Add(registerAppUser);
         _ahcmsContext.SaveChanges();
         return(Ok("Registration successful"));
     }
 }
Example #3
0
 public ActionResult Post([FromBody] Attendance attendanceToAdd)
 {
     _ahcmsContext.Attendances.Add(attendanceToAdd);
     return(Ok(_ahcmsContext.SaveChanges()));
 }
Example #4
0
 public ActionResult Post([FromBody] Place placeToAdd)
 {
     _ahcmsContext.Places.Add(placeToAdd);
     return(Ok(_ahcmsContext.SaveChanges()));
 }