Ejemplo n.º 1
0
        private async Task AddParticipanAsync(string userId, Guid eventId, ICollection <EventOption> eventOptions)
        {
            var timeStamp   = _systemClock.UtcNow;
            var participant = await _eventParticipantsDbSet
                              .Include(x => x.EventOptions)
                              .FirstOrDefaultAsync(p => p.EventId == eventId && p.ApplicationUserId == userId);

            if (participant == null)
            {
                var newParticipant = new EventParticipant
                {
                    ApplicationUserId = userId,
                    Created           = timeStamp,
                    CreatedBy         = userId,
                    EventId           = eventId,
                    Modified          = timeStamp,
                    ModifiedBy        = userId,
                    EventOptions      = eventOptions,
                    AttendComment     = string.Empty,
                    AttendStatus      = (int)AttendingStatus.Attending
                };
                _eventParticipantsDbSet.Add(newParticipant);
            }
            else
            {
                participant.Modified      = timeStamp;
                participant.ModifiedBy    = userId;
                participant.EventOptions  = eventOptions;
                participant.AttendStatus  = (int)AttendingStatus.Attending;
                participant.AttendComment = string.Empty;
            }
        }
Ejemplo n.º 2
0
        public async void UpdateGoogleEventParticipantStatus(EventParticipant ep)
        {
            try
            {
                var googleEventId = ep.Event.GoogleEventId;
                var googleEv      = await GetGoogleEvent(googleEventId);

                var status = ep.Status;
                if (ep.Status == "N/A")
                {
                    status = "needsAction";
                }

                if (googleEv.Attendees.FirstOrDefault(a => a.Email == ep.User.Email) == null)
                {
                    googleEv.Attendees.Add(new EventAttendee
                    {
                        DisplayName = ep.User.Name, Email = ep.User.Email, ResponseStatus = status
                    });
                }

                googleEv.Attendees.FirstOrDefault(a =>
                                                  a.Email == ep.User.Email).ResponseStatus = status;

                var updateRequest = _calendarService.Events.Update(googleEv, calendarId, googleEventId);
                updateRequest.SendUpdates = 0;
                await updateRequest.ExecuteAsync();
            }
            catch (Exception e)
            {
                e.Message.ToString();
            }
        }
        public async Task <IActionResult> PutEventParticipant(int id, EventParticipant eventParticipant)
        {
            if (id != eventParticipant.EventParticipantId)
            {
                return(BadRequest());
            }

            _context.Entry(eventParticipant).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EventParticipantExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 4
0
        public static void MarkAsSubmitted(IUser user)
        {
            EventParticipant target = GetParticipant(user);

            target.SetupSubmitted = true;
            WriteParticipantList();
        }
Ejemplo n.º 5
0
        public IActionResult DeleteEventParticipant([FromBody] EventParticipant eventParticipant)
        {
            BaseResult <EventModel> baseResult = new BaseResult <EventModel>();
            bool  isSuccess = false;
            int   userId    = Convert.ToInt32(HttpContext.User.Identity.Name);
            Event _event    = _SEvent.GetById(eventParticipant.eventId);

            if (userId == _event.userId)
            {
                if (_SEventParticipant.DeleteEventParticipant(eventParticipant.eventId, eventParticipant.userId))
                {
                    isSuccess = true;
                }
                else
                {
                    baseResult.errMessage = "Katılımcı Silinemedi!";
                }
            }
            else
            {
                baseResult.errMessage = "Kendinize Ait Olmayan Etkinliğe Müdahale Edemezsiniz";
            }
            if (isSuccess)
            {
                return(Json(baseResult));
            }
            else
            {
                baseResult.statusCode = HttpStatusCode.NotFound;
                return(new NotFoundObjectResult(baseResult));
            }
        }
Ejemplo n.º 6
0
        public EventResponse CancelEventParticipant(CancelEventRequest model)
        {
            var response       = new EventResponse();
            var loggedInmember = _memberProvider.GetLoggedInMember();

            if (loggedInmember == null)
            {
                Logger.Warn(typeof(EventController), "Unable to find logged in member record.");
                response.Error = "Unable to find logged in member record.";
                return(response);
            }

            var eventSlot = _eventSlotRepository.GetById(model.EventSlotId);

            if (eventSlot.Date.Date < DateTime.Now.Date)
            {
                response.Error = $"You can not cancel an event which is in the past.";
                return(response);
            }

            IMember eventMember;

            if (model.MemberId.HasValue)
            {
                eventMember = Services.MemberService.GetById(model.MemberId.Value);
                if (eventMember == null)
                {
                    Logger.Warn(typeof(EventController), $"Unable to find member with id {model.MemberId} for event cancellation.");
                    response.Error = $"Unable to find member with id {model.MemberId} for event cancellation.";
                    return(response);
                }
            }
            else
            {
                eventMember = loggedInmember;
                if (eventSlot.Date <= DateTime.Now)
                {
                    response.Error = $"You can not cancel an event which is in the past.";
                    return(response);
                }
            }


            EventParticipant eventParticipant = eventSlot.EventParticipants.FirstOrDefault(ep => ep.MemberId == eventMember.Id);

            if (eventParticipant == null)
            {
                Logger.Warn(typeof(EventController), $"Member {eventMember.Name} is not currently booked onto event slot {model.EventSlotId}.");
                response.Error = "You are not currently booked onto that event";
                return(response);
            }

            CancelEventParticipant(eventMember, eventParticipant);

            List <EventType> eventTypes = _dataTypeProvider.GetEventTypes();

            Logger.Info(typeof(EventController), $"Event slot cancelled - Member: {eventMember.Name} , Event: {eventTypes.SingleOrDefault(et => et.Id == eventSlot.EventTypeId)?.Name} on {eventSlot.Date.ToString("dd/MM/yyyy")} for £{eventParticipant.AmountPaid}.");

            return(response);
        }
        public async Task <ActionResult <EventParticipant> > PostEventParticipant(EventParticipant eventParticipant)
        {
            _context.EventParticipants.Add(eventParticipant);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEventParticipant", new { id = eventParticipant.EventParticipantId }, eventParticipant));
        }
Ejemplo n.º 8
0
        public virtual async Task <ActionResult> Participants(string EventId)
        {
            // Event Id must be an integer and found
            //
            Int32 eventId = 0;

            if (!Int32.TryParse(EventId, out eventId))
            {
                eventId = 0;
            }
            if (eventId == 0)
            {
                return(new HttpStatusCodeResult(400, "Invalid event Id"));
            }

            // Retrieve participants and format into appropriate view model
            //
            var attendings = await RaceDayClient.GetEventDetail(eventId);

            List <EventParticipant> participants = new List <EventParticipant>();

            foreach (var user in attendings.attendees)
            {
                participants.Add(EventParticipant.FromJson(user));
            }

            // return the rendered view with participants in it
            //
            AttendanceResult result = new AttendanceResult();

            result.Attendees = RenderPartialViewToString(MVC.Shared.Views.Partials._ParticipantList, participants);

            return(Json(result));
        }
Ejemplo n.º 9
0
        public async Task <EventParticipant> SignUpFreeEventAsync(Guid eventId, [CurrentUserGlobalState] CurrentUser currentUser)
        {
            var e = await _context.Events
                    .Include(e => e.EventPrices)
                    .SingleOrThrowAsync(e => e.EventId == eventId);

            var userSub = currentUser.GetSubscriptionIn(e.ClubId);

            if (!userSub.HasValue && e.PublicPrice != null)
            {
                throw new QueryException(
                          ErrorBuilder.New()
                          .SetMessage("The event is private")
                          .SetCode("USER_NOT_MEMBER")
                          .Build());
            }

            if (userSub == null)
            {
                userSub = Guid.Empty;
            }
            var userPrice = e.EventPrices.Find(ep => ep.ClubSubscriptionId == userSub.Value);

            if (userPrice == null)
            {
                throw new QueryException(
                          ErrorBuilder.New()
                          .SetMessage("Price is not configured so you cannot join")
                          .SetCode("USER_CANNOT_JOIN")
                          .Build());
            }

            if (Math.Abs(userPrice.Price) < 1)
            {
                var ep = new EventParticipant()
                {
                    EventId = eventId,
                    UserId  = currentUser.UserId
                };
                _context.EventParticipants.Add(ep);
                var @event = new SignUpEventSuccessEvent()
                {
                    UserId  = currentUser.UserId,
                    EventId = eventId
                };
                await _eventService.SaveEventAndDbContextChangesAsync(@event);

                await _eventService.PublishEventAsync(@event);

                return(ep);
            }
            else
            {
                throw new QueryException(
                          ErrorBuilder.New()
                          .SetMessage("Event is not free for your membership type.")
                          .SetCode("EVENT_IS_NOT_FREE")
                          .Build());
            }
        }
Ejemplo n.º 10
0
        private async Task AddParticipantWithStatusAsync(string userId, int attendingStatus, string attendComment, EventJoinValidationDto eventDto)
        {
            var timeStamp   = _systemClock.UtcNow;
            var participant = await _eventParticipantsDbSet.FirstOrDefaultAsync(p => p.EventId == eventDto.Id && p.ApplicationUserId == userId);

            if (participant != null)
            {
                participant.AttendStatus  = attendingStatus;
                participant.AttendComment = attendComment;
                participant.Modified      = timeStamp;
                participant.ModifiedBy    = userId;
            }
            else
            {
                var newParticipant = new EventParticipant
                {
                    ApplicationUserId = userId,
                    Created           = timeStamp,
                    CreatedBy         = userId,
                    EventId           = eventDto.Id,
                    Modified          = timeStamp,
                    ModifiedBy        = userId,
                    AttendComment     = attendComment,
                    AttendStatus      = attendingStatus
                };

                _eventParticipantsDbSet.Add(newParticipant);
            }
        }
Ejemplo n.º 11
0
        public virtual async Task <ActionResult> Attending(String EventId, String ClassName)
        {
            // Event Id must be an integer and found
            //
            Int32 eventId = 0;

            if (!Int32.TryParse(EventId, out eventId))
            {
                eventId = 0;
            }
            if (eventId == 0)
            {
                return(new HttpStatusCodeResult(400, "Invalid event Id"));
            }

            // ClassName must be recognized
            //
            if ((ClassName != "glyphicon-check") && (ClassName != "glyphicon-unchecked"))
            {
                return(new HttpStatusCodeResult(400, "Unrecognized class name"));
            }

            EventDetail eventDetail;

            // Switch the attendance
            //
            AttendanceResult result = new AttendanceResult();

            if (ClassName == "glyphicon-check")
            {
                await RaceDayClient.RemoveUserFromEvent(eventId);

                eventDetail = await RaceDayClient.GetEventDetail(eventId);

                result.Button = RenderPartialViewToString(MVC.Shared.Views.Partials._NotAttendingButton, EventInfo.CopyFromEventService(false, eventDetail));
            }
            else
            {
                await RaceDayClient.AddUserToEvent(eventId);

                eventDetail = await RaceDayClient.GetEventDetail(eventId);

                result.Button = RenderPartialViewToString(MVC.Shared.Views.Partials._AttendingButton, EventInfo.CopyFromEventService(true, eventDetail));
            }

            // Rebind the participant list with the change
            //
            List <EventParticipant> participants = new List <EventParticipant>();

            foreach (var user in eventDetail.attendees)
            {
                participants.Add(EventParticipant.FromJson(user));
            }

            result.Attendees = RenderPartialViewToString(MVC.Shared.Views.Partials._ParticipantList, participants);
            return(Json(result));
        }
Ejemplo n.º 12
0
        public async Task <IActionResult> Apply([Bind("ID,RoleID,Name,PassWd,Email,PhoneNum")] EventParticipant eventParticipant)
        {
            if (ModelState.IsValid)
            {
                await eventParticipantService.AddEP(eventParticipant);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventParticipant));
        }
Ejemplo n.º 13
0
        public async Task <EventParticipant> Verify(EventParticipant EP, string id)//检查,将所有未审核的participant展示出来
        {
            using (var db = _context)
            {
                //Event @event = (Event)db.Events.Where(item => item.Id == id);
                EventParticipant eventParticipant = await db.EventParticipants.Where(item => item.Id == EP.Id).FirstOrDefaultAsync();

                return(eventParticipant);
            }
        }
Ejemplo n.º 14
0
        public async Task <EventParticipant> Alter(EventParticipant EP, string id)//修改已审核participant申请表的PartiState
        {
            using (var db = _context)
            {
                //Event @event = (Event)db.Events.Where(item => item.Id == id);
                EventParticipant eventParticipant = await db.EventParticipants.Where(item => item.Id == EP.Id).FirstOrDefaultAsync();

                return(eventParticipant);
            }
        }
Ejemplo n.º 15
0
        public async Task Deny(EventParticipant EP, string id)//拒绝未审核,将event的PartiState修改为2
        {
            using (var db = _context)
            {
                EventParticipant eventParticipant = await db.EventParticipants.Where(item => item.Id == EP.Id).FirstOrDefaultAsync();

                eventParticipant.State = 2;
                db.EventParticipants.Update(eventParticipant);
                db.SaveChanges();
            }
        }
Ejemplo n.º 16
0
        // -----------登记participant成绩
        public async Task Check(EventParticipant EP, string id, string grade)//修改EP表的Grade属性
        {
            using (var db = _context)
            {
                //Event @event = (Event)db.Events.Where(item => item.Id == participant.ID);
                EventParticipant eventParticipant = await db.EventParticipants.Where(item => item.Id == EP.Id).FirstOrDefaultAsync();

                eventParticipant.Grade = grade;
                db.EventParticipants.Update(eventParticipant);
                db.SaveChanges();
            }
        }
Ejemplo n.º 17
0
        public void CheckIfEventExists(EventParticipant participant)
        {
            if (participant == null)
            {
                throw new ValidationException(ErrorCodes.ContentDoesNotExist, "Event does not exist");
            }

            if (participant.Event == null)
            {
                throw new ValidationException(ErrorCodes.ContentDoesNotExist, "Event does not exist");
            }
        }
Ejemplo n.º 18
0
        private void CancelEventParticipant(IMember eventMember, EventParticipant eventParticipant)
        {
            //Credit cost to members credits
            var credits = eventMember.GetValue <int>(MemberProperty.TrainingCredits);

            credits = credits + eventParticipant.AmountPaid;
            eventMember.SetValue(MemberProperty.TrainingCredits, credits);
            Services.MemberService.Save(eventMember);

            //Remove eventParticipant entry
            _eventParticipantRepository.Delete(eventParticipant.Id);
        }
Ejemplo n.º 19
0
        public void NotifyAboutEvent(EventParticipant eventUser)
        {
            _logger.LogMethodCallingWithObject(eventUser);

            var title = $"[EventObserver] {eventUser.Event.Name} уже скоро";
            var body  = "<h2>Напоминание о предстоящем событии</h2>" +
                        $"<p>{eventUser.Participant.UserName}, напоминаем, что уже скоро состоится мероприятие {eventUser.Event.Name}, на которое Вы записались.</p>" +
                        $"<p>Время: {eventUser.Event.Start:f}</p>" +
                        $"<p>Место: {eventUser.Event.Place}</p>" +
                        $"<p>Стоимость: {eventUser.Event.Fee}BYN</p>";

            SendMessage(title, body, eventUser.Participant.Email);
        }
Ejemplo n.º 20
0
        private async Task RemoveParticipantAsync(EventParticipant participant, Event @event, UserAndOrganizationDto userOrg)
        {
            var timestamp = DateTime.UtcNow;

            participant.UpdateMetadata(userOrg.UserId, timestamp);

            await _uow.SaveChangesAsync(false);

            await JoinOrLeaveEventWallAsync(@event.ResponsibleUserId, participant.ApplicationUserId, @event.WallId, userOrg);

            _eventParticipantsDbSet.Remove(participant);

            await _uow.SaveChangesAsync(false);
        }
Ejemplo n.º 21
0
        public async Task TryJoinEvent(IGuildUser user, EventRole er, string extra, bool extraChecks = true)
        {
            if (er.Event.GuildId != user.GuildId)
            {
                throw new Exception("Cross guild events are fobidden.");
            }
            if (extraChecks && er.ReamainingOpenings <= 0)
            {
                throw new Exception("No openings left.");
            }
            if (er.Event.Participants.Where(p => p.UserId == user.Id).Count() > 0)
            {
                throw new Exception("You are already participating.");
            }
            if (extraChecks && !er.Event.Active)
            {
                throw new Exception("Event is closed.");
            }

            if (er.Event.Guild.ParticipantRoleId != 0)
            {
                await user.AddRoleAsync(user.Guild.GetRole(er.Event.Guild.ParticipantRoleId));
            }

            var ep = new EventParticipant()
            {
                UserId = user.Id,
                Event  = er.Event,
                Role   = er
            };
            var embed = new EmbedBuilder()
                        .WithTitle($"{user} has joined event `{er.Event.Title}`")
                        .WithDescription($"They have chosen `{er.Title}` role.")
                        .WithColor(Color.Green);

            if (extra != null && extra != string.Empty)
            {
                embed.AddField("Provided details", $"`{extra}`");
                ep.UserData = extra;
            }
            _database.Add(ep);
            await _database.SaveChangesAsync();

            await UpdateEventMessage(er.Event);

            if (er.Event.Guild.EventRoleConfirmationChannelId != 0)
            {
                await(await user.Guild.GetTextChannelAsync(er.Event.Guild.EventRoleConfirmationChannelId)).SendMessageAsync(embed: embed.Build());
            }
        }
Ejemplo n.º 22
0
        public virtual ActionResult Participants(string EventId)
        {
            Repository repository = new Repository();

            // Current user must be logged in
            //
            if (FacebookUser.CurrentUser == null)
            {
                return(new HttpStatusCodeResult(400, "User authorization not found"));
            }

            // Event Id must be an integer and found
            //
            Int32 eventId = 0;

            if (!Int32.TryParse(EventId, out eventId))
            {
                eventId = 0;
            }
            if (eventId == 0)
            {
                return(new HttpStatusCodeResult(400, "Invalid event Id"));
            }

            Event currentEvent = repository.GetEventById(eventId);

            if (currentEvent == null)
            {
                return(new HttpStatusCodeResult(400, "Event record not found"));
            }

            // Retrieve participants and format into appropriate view model
            //
            var attendings = repository.GetUsersForEvent(currentEvent.EventId);
            List <EventParticipant> participants = new List <EventParticipant>();

            foreach (MFUser user in attendings)
            {
                participants.Add(EventParticipant.FromUser(user, FacebookUser.CurrentUser.access_token));
            }

            // return the rendered view with participants in it
            //
            AttendanceResult result = new AttendanceResult();

            result.Attendees = RenderPartialViewToString(MVC.Shared.Views.Partials._ParticipantList, participants);

            return(Json(result));
        }
Ejemplo n.º 23
0
        public MethodResult InviteContact(ContactsRequest contactRequest)
        {
            this.countryCodes = GetCountryCodes();
            String contactNumber        = contactRequest.ContactNumberForInvite;
            var    resCode              = Context.GetUserCountryCode(new Guid(contactRequest.RequestorId));
            string initiatorCountryCode = resCode.FirstOrDefault().ToString();

            EventParticipant ep = PhoneNumberHelper.FormatMobileNumberAndCountryCode(initiatorCountryCode, new EventParticipant()
            {
                MobileNumber = contactNumber, MobileNumberStoredInRequestorPhone = contactNumber
            }, this.countryCodes);


            return(SMSHelper.sendSMSGeneric(ep.CountryCode, ep.MobileNumber, 0, "", contactRequest.RequestorName, ""));
        }
Ejemplo n.º 24
0
 public async Task AddEP(EventParticipant ep) // 添加new Event
 {
     try
     {
         using (var db = _context)
         {
             db.EventParticipants.Add(ep);
             await db.SaveChangesAsync();
         }
     }
     catch (Exception e)
     {
         // TODO: 需要根据错误类型返回不同错误信息
         throw new ApplicationException($"添加活动出错{e.Message}");
     }
 }
        public void AddEventParticipantTest()
        {
            Event evt = Event.NewEvent();

            evt.EventID = -1;

            Participant participant = Participant.GetParticipantByID(-1);

            if (!participant.IsNew)
            {
                participant.ParticipantID = -1;
            }

            EventParticipant eventParticipant = EventParticipant.AddEventParticipant(evt, participant);

            Assert.IsNotNull(eventParticipant);
            Assert.IsTrue(eventParticipant.EventID == evt.EventID && eventParticipant.ParticipantID == participant.ParticipantID);
        }
Ejemplo n.º 26
0
        public EventParticipant ParseName(string line)
        {
            EventParticipant participant = new EventParticipant();
            string           str         = String.Empty;

            foreach (var item in Enum.GetValues(typeof(Allies)))
            {
                string countryName = item.ToString();
                if (countryName.Contains("_"))
                {
                    countryName = countryName.ToString().Replace("_", " ");
                }
                if (line.Contains(countryName))
                {
                    str = countryName;
                    participant.Name = str;
                }
            }
            if (!String.IsNullOrEmpty(str))
            {
                return(participant);
            }

            foreach (var item in Enum.GetValues(typeof(Axis)))
            {
                string countryName = item.ToString();
                if (countryName.Contains("_"))
                {
                    countryName = countryName.ToString().Replace("_", " ");
                }
                if (line.Contains(countryName))
                {
                    str = countryName;
                    participant.Name = str;
                }
            }

            if (String.IsNullOrEmpty(str))
            {
                participant.Name = "Unknown";
            }

            return(participant);
        }
Ejemplo n.º 27
0
 //报名,将对应的event添加到自己的List里面,并将EP的State改为0
 public async Task Apply(string EventId, string id)
 {
     using (var db = _context)
     {
         var _event       = db.Events.Where(item => item.Id == EventId).FirstOrDefault();
         var _participant = db.Participants.Where(item => item.ID == id).FirstOrDefault();
         EventParticipant eventParticipant = new EventParticipant(_event, _participant);
         eventParticipant.Id    = Guid.NewGuid().ToString();
         eventParticipant.Grade = "";
         //List<EventParticipant> @eventParticipants = ToListEP();
         //foreach (EventParticipant ep in @eventParticipants)
         //{
         //    if (ep.Equals(eventParticipant)) return;
         //}
         eventParticipant.State = 0;
         db.EventParticipants.Add(eventParticipant);
         await db.SaveChangesAsync();
     }
 }
Ejemplo n.º 28
0
        public void UserSignInCharityEvent(int userId, int charityEventId)
        {
            var exists = _context.EventParticipants.Any(x => x.UserId == userId && x.CharityEventId == charityEventId);

            if (exists)
            {
                return;
            }

            var newParticipant = new EventParticipant()
            {
                IsAccepted = null,
                ParticipationRequestDate = DateTime.Now,
                UserId         = userId,
                CharityEventId = charityEventId
            };

            _context.EventParticipants.Add(newParticipant);
            _context.SaveChanges();
        }
Ejemplo n.º 29
0
        public static EventForUserListDto ToEventForUserListDto(EventParticipant ev)
        {
            if (ev == null)
            {
                return(null);
            }

            return(new EventForUserListDto
            {
                Id = ev.Event.Id,
                Title = ev.Event.Title,
                Description = ev.Event.Description,
                ImageUrl = ev.Event.ImageUrl,
                Location = ev.Event.Location,
                StartDate = ev.Event.StartDate,
                EndDate = ev.Event.EndDate,
                CreatorId = ev.Event.CreatorId,
                Status = ev.Status,
                CreatorName = ev.Event.Creator.Name
            });
        }
Ejemplo n.º 30
0
        public ActionResult SignUp(int id)
        {
            var eventInDb = _context.Events.Single(e => e.Id == id);

            if (eventInDb == null)
            {
                return(HttpNotFound());
            }

            //var user = _context.Users.SingleOrDefault(u => u.Id == User.Identity.GetUserId());
            //eventt.Participants.Add(user);

            var participants = _context.EventParticipants.Where(evp => evp.EventId == eventInDb.Id).ToList();
            var userId       = User.Identity.GetUserId();

            if (participants.Contains(_context.EventParticipants.SingleOrDefault(evp => evp.EventId == eventInDb.Id && evp.UserId == userId)))
            {
                //Poruka da smo vec prijavljeni
                return(RedirectToAction("Index"));
            }

            if (participants.Count >= eventInDb.MaxNumber)
            {
                //Popunjena mesta
            }

            var signup = new EventParticipant
            {
                EventId = id,
                UserId  = User.Identity.GetUserId()
            };

            _context.EventParticipants.Add(signup);

            eventInDb.CurrentNumber = participants.Count + 1;

            _context.SaveChanges();

            return(RedirectToAction("Details", "Events", new { id = eventInDb.Id }));
        }