Esempio n. 1
0
        /// <summary>
        /// Gets list of team members who were interested in an event for the admin to see
        /// </summary>
        /// <param name="eventId">the id of the event to load ticket view for</param>
        /// <returns>Ticket claims info for an event</returns>
        public ActionResult LoadTicketGiveAwayView(int eventId)
        {
            AdminModel model = new AdminModel();

            if (!AllowAccess())
            {
                return(View(ViewNames.FailedToAuthenticate));
            }

            model.UserLoginName = claimsHelper.GetUserNameFromClaim((ClaimsIdentity)User.Identity);
            GetEventByEventId eventQuery = new GetEventByEventId(eventId);

            model.Event = commandBus.ProcessQuery(eventQuery);

            GetAllWinnersForEventQuery winnersQuery = new GetAllWinnersForEventQuery(eventId);

            model.Event.WinnersForEvent = commandBus.ProcessQuery(winnersQuery);

            GetAllNonWinnersForEventQuery nonWinnersQuery = new GetAllNonWinnersForEventQuery(eventId);

            model.Event.NonWinnersForEvent = commandBus.ProcessQuery(nonWinnersQuery);

            GetTicketClaimsByEventIdQuery ticketClaimQuery = new GetTicketClaimsByEventIdQuery(eventId);

            model.TicketClaims = commandBus.ProcessQuery(ticketClaimQuery);

            return(View(ViewNames.SelectTicketWinner, model));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the details of a particular event based on its id
        /// </summary>
        /// <param name="eventId">the id of the event to get the details of</param>
        /// <returns>Event Details View</returns>
        public ActionResult EventDetails(int eventId)
        {
            EventModel model = new EventModel();

            model.UserLoginName = claimsHelper.GetUserNameFromClaim((ClaimsIdentity)User.Identity);

            GetEventByEventId eventQuery = new GetEventByEventId(eventId);

            model.Event = commandBus.ProcessQuery(eventQuery);

            GetEventPostPictures pictureQuery = new GetEventPostPictures(eventId);

            model.Pictures = commandBus.ProcessQuery(pictureQuery);

            GetTicketClaimsByEventIdQuery ticketClaimQuery = new GetTicketClaimsByEventIdQuery(eventId);

            model.TicketClaims = commandBus.ProcessQuery(ticketClaimQuery);

            SelectUserQuery userQuery = new SelectUserQuery(new CurrentUser {
                LoginName = claimsHelper.GetUserNameFromClaim((ClaimsIdentity)User.Identity)
            });

            model.OrgChartUser = commandBus.ProcessQuery(userQuery);

            return(View(ViewNames.EventDetails, model));
        }
Esempio n. 3
0
        /// <summary>
        /// Pre-populates the create new event form to edit an event based on its event id
        /// </summary>
        /// <param name="eventId"></param>
        /// <returns>Create new event form</returns>
        public ActionResult EditEventDetails(int eventId)
        {
            AdminModel model = new AdminModel();

            if (!AllowAccess())
            {
                return(View(ViewNames.FailedToAuthenticate));
            }

            model.UserLoginName = claimsHelper.GetUserNameFromClaim((ClaimsIdentity)User.Identity);
            GetEventByEventId eventQuery = new GetEventByEventId(eventId);

            model.Event = commandBus.ProcessQuery(eventQuery);

            IEnumerable <TicketCategoryEnum> categoryEnum = Enumeration.GetAll <TicketCategoryEnum>().ToList();
            IEnumerable <SelectListItem>     categoryList = categoryEnum.Select(item => new SelectListItem()
            {
                Text     = item.DisplayValue,
                Value    = item.Id,
                Selected = item.Id.Equals(model.Event.CategoryId.Id)
            });

            model.EventCategories = new SelectList(categoryEnum);

            GetEventPostPictures pictureQuery = new GetEventPostPictures(eventId);

            model.Pictures = commandBus.ProcessQuery(pictureQuery);

            GetTicketClaimsByEventIdQuery ticketClaimQuery = new GetTicketClaimsByEventIdQuery(eventId);

            model.TicketClaims = commandBus.ProcessQuery(ticketClaimQuery);

            GetAllEventsQuery activeEvents = new GetAllEventsQuery();

            model.Events = commandBus.ProcessQuery(activeEvents);

            return(View(ViewNames.AdminHomePage, model));
        }
Esempio n. 4
0
        /// <summary>
        /// Handler for the GetticketClaimsByEventIdQuery
        /// </summary>
        /// <param name="query">The GetTicketClaimsByEventIdQuery</param>
        /// <returns>the information retrieved from the database.</returns>
        public List <TicketClaims> Handle(GetTicketClaimsByEventIdQuery query)
        {
            List <TicketClaims> claims = ticketClaimClaimsRepository.GetTicketClaimsByEventId(query.EventId);

            return(claims);
        }