public CreateModel(
     ApplicationDbContext context,
     IEventInfoRetrievalService eventInfoRetrievalService)
 {
     _context = context;
     _eventInfoRetrievalService = eventInfoRetrievalService;
 }
        public EventCertificatesController(
            IEventInfoRetrievalService eventInfoRetrievalService,
            ICertificateRenderer certificateRenderer,
            ICertificateIssuingService certificateIssuingService,
            ICertificateDeliveryService certificateDeliveryService,
            IEventInfoAccessControlService eventInfoAccessControlService,
            ICertificateRetrievalService certificateRetrievalService)
        {
            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _certificateRenderer = certificateRenderer ?? throw
                                       new ArgumentNullException(nameof(certificateRenderer));

            _certificateIssuingService = certificateIssuingService ?? throw
                                             new ArgumentNullException(nameof(certificateIssuingService));

            _certificateDeliveryService = certificateDeliveryService ?? throw
                                              new ArgumentNullException(nameof(certificateDeliveryService));

            _eventInfoAccessControlService = eventInfoAccessControlService ?? throw
                                                 new ArgumentNullException(nameof(eventInfoAccessControlService));

            _certificateRetrievalService = certificateRetrievalService ?? throw
                                               new ArgumentNullException(nameof(certificateRetrievalService));
        }
Exemple #3
0
 public ExternalEventsController(
     IExternalEventManagementService externalEventManagementService,
     IEventInfoRetrievalService eventInfoService)
 {
     _externalEventManagementService = externalEventManagementService ?? throw new ArgumentNullException(nameof(externalEventManagementService));
     _eventInfoService = eventInfoService ?? throw new ArgumentNullException(nameof(eventInfoService));
 }
 /// <summary>
 /// Shortcut for <see cref="IEventInfoRetrievalService.GetEventInfoByIdAsync"/>.
 /// </summary>
 public static Task <EventInfo> GetEventInfoByIdAsync(
     this IEventInfoRetrievalService service,
     int id,
     CancellationToken cancellationToken = default)
 {
     return(service.GetEventInfoByIdAsync(id, null, cancellationToken));
 }
Exemple #5
0
 public EventProductsModel(
     IEventInfoRetrievalService eventsService,
     IEventManagementService eventManagementService)
 {
     _eventsService          = eventsService;
     _eventManagementService = eventManagementService;
 }
Exemple #6
0
        public NotificationManagementService(
            IEventInfoRetrievalService eventInfoRetrievalService,
            IEventInfoAccessControlService eventInfoAccessControlService,
            ICurrentOrganizationAccessorService currentOrganizationAccessorService,
            IRegistrationRetrievalService registrationRetrievalService,
            IHttpContextAccessor httpContextAccessor,
            ApplicationDbContext context)
        {
            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _eventInfoAccessControlService = eventInfoAccessControlService ?? throw
                                                 new ArgumentNullException(nameof(eventInfoAccessControlService));

            _currentOrganizationAccessorService = currentOrganizationAccessorService ?? throw
                                                      new ArgumentNullException(nameof(currentOrganizationAccessorService));

            _registrationRetrievalService = registrationRetrievalService ?? throw
                                                new ArgumentNullException(nameof(registrationRetrievalService));

            _httpContextAccessor = httpContextAccessor ?? throw
                                       new ArgumentNullException(nameof(httpContextAccessor));

            _context = context ?? throw
                           new ArgumentNullException(nameof(context));
        }
Exemple #7
0
 public EditModel(
     IEventManagementService eventsService,
     IEventInfoRetrievalService eventInfoRetrievalService,
     ICurrentOrganizationAccessorService currentOrganizationAccessorService)
 {
     _eventsService                      = eventsService;
     _eventInfoRetrievalService          = eventInfoRetrievalService;
     _currentOrganizationAccessorService = currentOrganizationAccessorService;
 }
 public DetailsModel(
     ApplicationDbContext context,
     IEventSynchronizationService eventSynchronizationService,
     IEventInfoRetrievalService eventInfoRetrievalService)
 {
     _eventSynchronizationService = eventSynchronizationService ?? throw new ArgumentNullException(nameof(eventSynchronizationService));
     _eventInfoRetrievalService   = eventInfoRetrievalService ?? throw new ArgumentNullException(nameof(eventInfoRetrievalService));
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Exemple #9
0
 public AddExternalEventModel(
     IEventSynchronizationService eventSynchronizationService,
     IEventInfoRetrievalService eventInfoRetrievalService,
     IExternalEventManagementService externalEventManagementService)
 {
     _eventSynchronizationService    = eventSynchronizationService ?? throw new ArgumentNullException(nameof(eventSynchronizationService));
     _eventInfoRetrievalService      = eventInfoRetrievalService ?? throw new ArgumentNullException(nameof(eventInfoRetrievalService));
     _externalEventManagementService = externalEventManagementService ?? throw new ArgumentNullException(nameof(externalEventManagementService));
 }
Exemple #10
0
 public AddRegistrationModel(IOrderService orders, IEventInfoRetrievalService eventInfos, IRegistrationService registrations, IPaymentMethodService paymentMethods, UserManager <ApplicationUser> userManager, ApplicationDbContext db)
 {
     _eventsService        = eventInfos;
     _orders               = orders;
     _registrations        = registrations;
     _paymentMethodService = paymentMethods;
     _userManager          = userManager;
     _db = db;
 }
 public CertificatesController(
     ICertificateIssuingService certificateIssuingService,
     ICertificateDeliveryService certificateDeliveryService,
     IEventInfoRetrievalService eventInfoRetrievalService)
 {
     _certificateIssuingService  = certificateIssuingService;
     _certificateDeliveryService = certificateDeliveryService;
     _eventInfoRetrievalService  = eventInfoRetrievalService;
 }
        public EventProductVariantsController(
            IEventInfoRetrievalService eventInfoRetrievalService,
            IEventProductsManagementService eventProductsManagementService)
        {
            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _eventProductsManagementService = eventProductsManagementService ?? throw
                                                  new ArgumentNullException(nameof(eventProductsManagementService));
        }
Exemple #13
0
 public EditModel(
     ApplicationDbContext context,
     IPaymentMethodService paymentMethods,
     IEventInfoRetrievalService eventInfoRetrievalService,
     IUserRetrievalService userListingService)
 {
     _context                   = context;
     _paymentMethods            = paymentMethods;
     _eventInfoRetrievalService = eventInfoRetrievalService;
     _userListingService        = userListingService;
 }
 public EventSynchronizationService(
     IEnumerable <IExternalSyncProviderService> syncProviderServices,
     ILogger <EventSynchronizationService> logger,
     IRegistrationRetrievalService registrationRetrievalService,
     IEventInfoRetrievalService eventInfoRetrievalService)
 {
     _syncProviderServices = syncProviderServices ?? throw new ArgumentNullException(nameof(syncProviderServices));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _registrationRetrievalService = registrationRetrievalService ?? throw new ArgumentNullException(nameof(registrationRetrievalService));
     _eventInfoRetrievalService    = eventInfoRetrievalService ?? throw new ArgumentNullException(nameof(eventInfoRetrievalService));
 }
Exemple #15
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 #16
0
        public async Task <IActionResult> ViewCertificateForEvent([FromRoute] int id,
                                                                  [FromServices] IEventInfoRetrievalService eventInfoService)
        {
            var eventInfo = await eventInfoService.GetEventInfoByIdAsync(id, new EventInfoRetrievalOptions
            {
                LoadOrganizerUser = true,
                LoadOrganization  = true
            });

            if (eventInfo == null)
            {
                return(NotFound());
            }
            var vm = CertificateVM.Mock;

            vm.Title       = eventInfo.Title;
            vm.Description = eventInfo.CertificateDescription;

            vm.EvidenceDescription = $"{eventInfo.Title} {eventInfo.City}";
            if (eventInfo.DateStart.HasValue)
            {
                vm.EvidenceDescription += " - " + eventInfo.DateStart.Value.ToString("d");
            }
            ;
            if (eventInfo.DateEnd.HasValue)
            {
                vm.EvidenceDescription += " - " + eventInfo.DateEnd.Value.ToString("d");
            }
            ;

            vm.IssuedInCity = eventInfo.City;

            if (eventInfo.OrganizerUser != null)
            {
                vm.IssuerPersonName = eventInfo.OrganizerUser.Name;
            }

            if (eventInfo.OrganizerUser != null && !string.IsNullOrWhiteSpace(eventInfo.OrganizerUser.SignatureImageBase64))
            {
                vm.IssuerPersonSignatureImageBase64 = eventInfo.OrganizerUser.SignatureImageBase64;
            }

            if (eventInfo.Organization != null)
            {
                vm.IssuerOrganizationName = eventInfo.Organization.Name;
            }

            if (eventInfo.Organization != null && !string.IsNullOrWhiteSpace(eventInfo.Organization.LogoBase64))
            {
                vm.IssuerOrganizationLogoBase64 = eventInfo.Organization.LogoBase64;
            }

            return(View("Templates/Certificates/CourseCertificate", vm));
        }
Exemple #17
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));
 }
Exemple #18
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));
 }
 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 #20
0
        public EventProductsManagementService(
            ApplicationDbContext context,
            IEventInfoRetrievalService eventInfoRetrievalService,
            IEventInfoAccessControlService accessControlService)
        {
            _context = context ?? throw
                           new ArgumentNullException(nameof(context));

            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _accessControlService = accessControlService ?? throw
                                        new ArgumentNullException(nameof(accessControlService));
        }
        public RegistrationAccessControlService(
            IHttpContextAccessor httpContextAccessor,
            IEventInfoRetrievalService eventInfoRetrievalService,
            ICurrentOrganizationAccessorService currentOrganizationAccessorService)
        {
            _httpContextAccessor = httpContextAccessor ?? throw
                                       new ArgumentNullException(nameof(httpContextAccessor));

            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _currentOrganizationAccessorService = currentOrganizationAccessorService ?? throw
                                                      new ArgumentNullException(nameof(currentOrganizationAccessorService));
        }
Exemple #22
0
        public CertificateController(
            ICertificateRetrievalService certificateRetrievalService,
            IEventInfoRetrievalService eventInfoRetrievalService,
            ICertificateRenderer certificateRenderer)
        {
            _certificateRetrievalService = certificateRetrievalService ?? throw
                                               new ArgumentNullException(nameof(certificateRetrievalService));

            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _certificateRenderer = certificateRenderer ?? throw
                                       new ArgumentNullException(nameof(certificateRenderer));
        }
Exemple #23
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 EventRegistrationModel(
     UserManager <ApplicationUser> userManager,
     RegistrationEmailSender registrationEmailSender,
     ILogger <EventRegistrationModel> logger,
     IEventInfoRetrievalService eventsService,
     IPaymentMethodService paymentMethodService,
     IRegistrationService registrationService,
     IStringLocalizer <EventRegistrationModel> stringLocalizer)
 {
     _userManager             = userManager;
     _logger                  = logger;
     _eventsService           = eventsService;
     _paymentMethodService    = paymentMethodService;
     _registrationService     = registrationService;
     _stringLocalizer         = stringLocalizer;
     _registrationEmailSender = registrationEmailSender;
 }
 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));
 }
        public RegistrationManagementService(
            IRegistrationAccessControlService registrationAccessControlService,
            IEventInfoRetrievalService eventInfoRetrievalService,
            IUserRetrievalService userRetrievalService,
            ApplicationDbContext context)
        {
            _registrationAccessControlService = registrationAccessControlService ?? throw
                                                    new ArgumentNullException(nameof(context));

            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _userRetrievalService = userRetrievalService ?? throw
                                        new ArgumentNullException(nameof(userRetrievalService));

            _context = context ?? throw
                           new ArgumentNullException(nameof(context));
        }
        public EventProductsController(
            IProductRetrievalService productRetrievalService,
            IEventInfoRetrievalService eventInfoRetrievalService,
            IEventProductsManagementService eventProductsManagementService,
            IEventInfoAccessControlService eventInfoAccessControlService)
        {
            _productRetrievalService = productRetrievalService ?? throw
                                           new ArgumentNullException(nameof(productRetrievalService));

            _eventInfoRetrievalService = eventInfoRetrievalService ?? throw
                                             new ArgumentNullException(nameof(eventInfoRetrievalService));

            _eventProductsManagementService = eventProductsManagementService ?? throw
                                                  new ArgumentNullException(nameof(eventProductsManagementService));

            _eventInfoAccessControlService = eventInfoAccessControlService ?? throw
                                                 new ArgumentNullException(nameof(eventInfoAccessControlService));
        }
Exemple #29
0
 public EventInfosController(IEventInfoRetrievalService eventInfoService)
 {
     _eventInfoService = eventInfoService;
 }
 public OnlineCourseController(IEventInfoRetrievalService eventInfoService)
 {
     _eventInfoService = eventInfoService;
 }