Beispiel #1
0
        public async Task <IActionResult> AddEvent(EventIndexBindingModel model)
        {
            int hours = model.AddEventInputModel.Date.Subtract(DateTime.UtcNow).Hours;

            if (ModelState.IsValid && model.AddEventInputModel.Date.Subtract(DateTime.UtcNow).Hours > 0)
            {
                await this.eventService.AddEvent(model.AddEventInputModel);
            }
            return(this.Redirect($"/Event/Index/{model.AddEventInputModel.ClubId}"));
        }
Beispiel #2
0
        public async Task <IActionResult> ExpiredEvents(string id)
        {
            Club club = await this.clubService.GetClubById(id);

            IList <Event> events = await this.eventService.GetUpExpiredEventsForClub(id);

            string currentUserId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
            User   currentUser   = await this.userService.FindUserById(currentUserId);

            IList <Message> messages = await this.clubService.GetAllMessagesForClub(club.Id);

            EventIndexBindingModel model = new EventIndexBindingModel()
            {
                Club          = club,
                ClubPriceType = club.PriceType.ToString(),
                Events        = events,
                CurrentUser   = currentUser,
                Messages      = messages
            };

            return(this.View(model));
        }