Esempio n. 1
0
        public IActionResult JoinUser(IDictionary <string, string> rv)
        {
            int    eventId    = int.Parse(rv["eventId"]);
            int    positionId = int.Parse(rv["positionId"]);
            string joinID     = this.userManager.GetUserId(User);

            if (!attendanceService.GetAllEventAttendeesForEvent(eventId).Any(a => a.UserId == joinID))
            {
                attendanceService.RegisterUserForEvent(joinID, eventId, positionId).Wait();
            }

            return(RedirectToAction("HomePageView", "HomePage"));
        }
Esempio n. 2
0
        public IActionResult JoinUser(JoinUserModel model)
        {
            int    eventId    = model.EventId;
            int    positionId = model.PositionId;
            string joinId     = this.userManager.GetUserId(User);

            if (!attendanceService.GetAllEventAttendeesForEvent(eventId).Any(a => a.UserId == joinId))
            {
                attendanceService.RegisterUserForEvent(joinId, eventId, positionId).Wait();
            }

            return(RedirectToAction("DetermineEventView", "HomePage", new { Id = eventId }));
        }