public async Task <IActionResult> OnGetAsync()
 {
     ViewData["EventInfoId"]   = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
     ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name");
     ViewData["UserId"]        = new SelectList(await _userListingService.ListUsers(), "Id", "Id");
     return(Page());
 }
Exemple #2
0
 public static async Task <List <EventInfo> > GetUnpublishedEventsAsync(this IEventInfoRetrievalService service, EventInfoRetrievalOptions options = null)
 {
     return(await service.ListEventsAsync(new EventInfoFilter
     {
         StatusOneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         }
     }, EventRetrievalOrder.StartDate, options));
 }
Exemple #3
0
 public static async Task <List <EventInfo> > GetUpcomingEventsAsync(this IEventInfoRetrievalService service, EventInfoRetrievalOptions options = null)
 {
     return(await service.ListEventsAsync(new EventInfoFilter
     {
         StatusNoneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         },
         StartDateAfter = DateTime.Now
     }, EventRetrievalOrder.StartDate, options));
 }
Exemple #4
0
 public static async Task <List <EventInfo> > GetOngoingEventsAsync(this IEventInfoRetrievalService service, EventInfoRetrievalOptions options = null)
 {
     return(await service.ListEventsAsync(new EventInfoFilter
     {
         TodaysEventsOnly = true,
         StatusNoneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         }
     }, EventRetrievalOrder.StartDate, options));
 }
 public static async Task <List <EventInfo> > GetPastEventsAsync(
     this IEventInfoRetrievalService service,
     EventInfoFilter filter              = null,
     EventInfoRetrievalOptions options   = null,
     CancellationToken cancellationToken = default)
 {
     return((await PageReader <EventInfo> .ReadAllAsync((offset, limit, token) =>
                                                        service.ListEventsAsync(new EventListRequest(offset, limit)
     {
         Filter = EventInfoFilter.PastEvents(filter)
     }, options, token), cancellationToken))
            .ToList());
 }
Exemple #6
0
        public async Task <PageResponseDto <EventDto> > List(
            [FromQuery] EventsQueryDto query,
            CancellationToken cancellationToken)
        {
            var events = await _eventInfoService
                         .ListEventsAsync(new EventListRequest(query.Offset, query.Limit)
            {
                Filter = query.ToEventInfoFilter()
            }, cancellationToken : cancellationToken);

            return(PageResponseDto <EventDto> .FromPaging(
                       query, events, e => new EventDto(e)));
        }
Exemple #7
0
 public static async Task <List <EventInfo> > GetOnDemandEventsAsync(this IEventInfoRetrievalService service, EventInfoRetrievalOptions options = null)
 {
     return(await service.ListEventsAsync(new EventInfoFilter
     {
         StatusNoneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         },
         TypeOneOf = new[]
         {
             EventInfo.EventInfoType.OnlineCourse
         }
     }, EventRetrievalOrder.Title, options));
 }
 public static async Task <List <EventInfo> > GetUnpublishedEventsAsync(
     this IEventInfoRetrievalService service,
     EventInfoFilter filter              = null,
     EventInfoRetrievalOptions options   = null,
     CancellationToken cancellationToken = default)
 {
     return(await service.ListEventsAsync(new EventInfoFilter(filter ?? new EventInfoFilter())
     {
         StatusOneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         }
     }, EventRetrievalOrder.StartDate, options, cancellationToken));
 }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Product = await _context.Products
                      .Include(p => p.Eventinfo).SingleOrDefaultAsync(m => m.ProductId == id);

            if (Product == null)
            {
                return(NotFound());
            }
            ViewData["EventInfoId"] = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
            return(Page());
        }
 public static async Task <List <EventInfo> > GetFeaturedEventsAsync(
     this IEventInfoRetrievalService service,
     EventInfoFilter filter              = null,
     EventInfoRetrievalOptions options   = null,
     CancellationToken cancellationToken = default)
 {
     return(await service.ListEventsAsync(new EventInfoFilter(filter ?? new EventInfoFilter())
     {
         FeaturedOnly = true,
         StatusNoneOf = new[]
         {
             EventInfo.EventInfoStatus.Cancelled,
             EventInfo.EventInfoStatus.Draft
         },
         StartDateAfter = DateTime.Now
     }, EventRetrievalOrder.StartDate, options, cancellationToken));
 }
Exemple #11
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Registration = await _context.Registrations
                           .Include(r => r.EventInfo)
                           .Include(r => r.User)
                           .SingleOrDefaultAsync(m => m.RegistrationId == id);

            if (Registration == null)
            {
                return(NotFound());
            }
            ViewData["EventInfoId"]   = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
            ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name");
            ViewData["UserId"]        = new SelectList(await _userListingService.ListAccessibleUsers(), "Id", "Id");
            return(Page());
        }
 public async Task <IActionResult> OnGet()
 {
     ViewData["EventInfoId"] = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
     return(Page());
 }