Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserProfileService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="patientService">The patient service.</param>
 /// <param name="userEmailService">The User Email service.</param>
 /// <param name="userSMSService">The User SMS service.</param>
 /// <param name="configurationService">The configuration service.</param>
 /// <param name="emailQueueService">The email service to queue emails.</param>
 /// <param name="notificationSettingsService">The Notifications Settings service.</param>
 /// <param name="userProfileDelegate">The profile delegate to interact with the DB.</param>
 /// <param name="userPreferenceDelegate">The preference delegate to interact with the DB.</param>
 /// <param name="legalAgreementDelegate">The terms of service delegate.</param>
 /// <param name="messageVerificationDelegate">The message verification delegate.</param>
 /// <param name="cryptoDelegate">Injected Crypto delegate.</param>
 /// <param name="httpContextAccessor">The injected http context accessor provider.</param>
 public UserProfileService(
     ILogger <UserProfileService> logger,
     IPatientService patientService,
     IUserEmailService userEmailService,
     IUserSMSService userSMSService,
     IConfigurationService configurationService,
     IEmailQueueService emailQueueService,
     INotificationSettingsService notificationSettingsService,
     IUserProfileDelegate userProfileDelegate,
     IUserPreferenceDelegate userPreferenceDelegate,
     ILegalAgreementDelegate legalAgreementDelegate,
     IMessagingVerificationDelegate messageVerificationDelegate,
     ICryptoDelegate cryptoDelegate,
     IHttpContextAccessor httpContextAccessor)
 {
     this.logger                      = logger;
     this.patientService              = patientService;
     this.userEmailService            = userEmailService;
     this.userSMSService              = userSMSService;
     this.configurationService        = configurationService;
     this.emailQueueService           = emailQueueService;
     this.notificationSettingsService = notificationSettingsService;
     this.userProfileDelegate         = userProfileDelegate;
     this.userPreferenceDelegate      = userPreferenceDelegate;
     this.legalAgreementDelegate      = legalAgreementDelegate;
     this.messageVerificationDelegate = messageVerificationDelegate;
     this.cryptoDelegate              = cryptoDelegate;
     this.httpContextAccessor         = httpContextAccessor;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserProfileService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="userProfileDelegate">The profile delegate to interact with the DB.</param>
 /// <param name="userPreferenceDelegate">The preference delegate to interact with the DB.</param>
 /// <param name="emailDelegate">The email delegate to interact with the DB.</param>
 /// <param name="emailInviteDelegate">The email invite delegate to interact with the DB.</param>
 /// <param name="configuration">The configuration service.</param>
 /// <param name="emailQueueService">The email service to queue emails.</param>
 /// <param name="legalAgreementDelegate">The terms of service delegate.</param>
 /// <param name="cryptoDelegate">Injected Crypto delegate.</param>
 /// <param name="notificationSettingsService">Notification settings delegate.</param>
 /// <param name="messageVerificationDelegate">The message verification delegate to interact with the DB.</param>
 /// <param name="patientService">The patient service.</param>
 public UserProfileService(
     ILogger <UserProfileService> logger,
     IUserProfileDelegate userProfileDelegate,
     IUserPreferenceDelegate userPreferenceDelegate,
     IEmailDelegate emailDelegate,
     IMessagingVerificationDelegate emailInviteDelegate,
     IConfigurationService configuration,
     IEmailQueueService emailQueueService,
     ILegalAgreementDelegate legalAgreementDelegate,
     ICryptoDelegate cryptoDelegate,
     INotificationSettingsService notificationSettingsService,
     IMessagingVerificationDelegate messageVerificationDelegate,
     IPatientService patientService)
 {
     this.logger = logger;
     this.userProfileDelegate         = userProfileDelegate;
     this.userPreferenceDelegate      = userPreferenceDelegate;
     this.emailDelegate               = emailDelegate;
     this.emailInviteDelegate         = emailInviteDelegate;
     this.configurationService        = configuration;
     this.emailQueueService           = emailQueueService;
     this.legalAgreementDelegate      = legalAgreementDelegate;
     this.cryptoDelegate              = cryptoDelegate;
     this.notificationSettingsService = notificationSettingsService;
     this.messageVerificationDelegate = messageVerificationDelegate;
     this.patientService              = patientService;
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CloseAccountJob"/> class.
        /// </summary>
        /// <param name="configuration">The configuration to use.</param>
        /// <param name="logger">The logger to use.</param>
        /// <param name="profileDelegate">The profile delegate.</param>
        /// <param name="emailService">The email service.</param>
        /// <param name="authDelegate">The OAuth2 authentication service.</param>
        /// <param name="userAdminDelegate">The AccessManagement userAdmin delegate.</param>
        /// <param name="dbContext">The db context to use.</param>
        public CloseAccountJob(
            IConfiguration configuration,
            ILogger <CloseAccountJob> logger,
            IUserProfileDelegate profileDelegate,
            IEmailQueueService emailService,
            IAuthenticationDelegate authDelegate,
            IUserAdminDelegate userAdminDelegate,
            GatewayDbContext dbContext)
        {
            this.configuration       = configuration;
            this.logger              = logger;
            this.profileDelegate     = profileDelegate;
            this.emailService        = emailService;
            this.authDelegate        = authDelegate;
            this.userAdminDelegate   = userAdminDelegate;
            this.dbContext           = dbContext;
            this.profilesPageSize    = this.configuration.GetValue <int>($"{JobKey}:{ProfilesPageSizeKey}");
            this.hoursBeforeDeletion = this.configuration.GetValue <int>($"{JobKey}:{HoursDeletionKey}") * -1;
            this.emailTemplate       = this.configuration.GetValue <string>($"{JobKey}:{EmailTemplateKey}");

            IConfigurationSection?configSection = configuration?.GetSection(AuthConfigSectionName);

            this.tokenUri = configSection.GetValue <Uri>(@"AuthTokenUri");

            this.tokenRequest = new ClientCredentialsTokenRequest();
            configSection.Bind(this.tokenRequest);
        }
Example #4
0
 public LoginController(IUnitOfWork unitOfWork, IUserService userService, IRoleService roleService,
     IEmailTemplateService emailTemplateService, IEmailQueueService emailQueueService)
 {
     this._unitOfWork = unitOfWork;
     this._userService = userService;
     this._roleService = roleService;
     this._emailTemplateService = emailTemplateService;
     this._emailQueueService = emailQueueService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailAdminController"/> class.
 /// </summary>
 /// <param name="logger">The injected ILogger.</param>
 /// <param name="emailAdminService">The injected user email admin service.</param>
 /// <param name="emailQueueService">The injected user email queue service.</param>
 public EmailAdminController(
     ILogger <EmailAdminController> logger,
     IEmailAdminService emailAdminService,
     IEmailQueueService emailQueueService)
 {
     this.logger            = logger;
     this.emailAdminService = emailAdminService;
     this.emailQueueService = emailQueueService;
 }
Example #6
0
 public EmailService(
     IConfigurationSettings configuration,
     IEmailTemplateService templateService,
     IEmailQueueService queueService,
     ISettingService settingService)
 {
     _configuration   = configuration;
     _templateService = templateService;
     _queueService    = queueService;
     _settingService  = settingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserEmailService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="messageVerificationDelegate">The message verification delegate to interact with the DB.</param>
 /// <param name="profileDelegate">The profile delegate to interact with the DB.</param>
 /// <param name="emailQueueService">The email service to queue emails.</param>
 /// <param name="notificationSettingsService">Notification settings delegate.</param>
 public UserEmailService(
     ILogger <UserEmailService> logger,
     IMessagingVerificationDelegate messageVerificationDelegate,
     IUserProfileDelegate profileDelegate,
     IEmailQueueService emailQueueService,
     INotificationSettingsService notificationSettingsService)
 {
     this.logger = logger;
     this.messageVerificationDelegate = messageVerificationDelegate;
     this.profileDelegate             = profileDelegate;
     this.emailQueueService           = emailQueueService;
     this.notificationSettingsService = notificationSettingsService;
 }
Example #8
0
 public StaticPageViewModelService(IRepository <ProductPricing> ProductPricing, IRepository <CMSPage> CMSPage, IRepository <CMSPageContent> CMSPageContent, IUnitOfWork UnitOfWork, IRepository <User> User,
                                   IEmailQueueService pEmailQueueService, IRepository <ResellerContract> ResellerContract, IRepository <Contract> Contract, IRepository <Product> ProductsData)
 {
     _productPricing = ProductPricing;
     _CMSPage        = CMSPage;
     _CMSPageContent = CMSPageContent;
     _unitOfWork     = UnitOfWork;
     _User           = User;
     //_EmailTemplates = EmailTemplates;
     _EmailQueueService = pEmailQueueService;
     _ResellerContract  = ResellerContract;
     _Contract          = Contract;
     _products          = ProductsData;
 }
Example #9
0
 public HomeController(IUnitOfWork unitOfWork, ICategoryService categoryService,
     IBannerService bannerService, IEmailQueueService emailQueueService,
     IEmailTemplateService emailTemplateService, IContentService contentService,
     IProductService productService, ISolutionService solutionService)
 {
     this._unitOfWork = unitOfWork;
     this._categoryService = categoryService;
     this._bannerService = bannerService;
     this._emailQueueService = emailQueueService;
     this._emailTemplateService = emailTemplateService;
     this._contactService = contentService;
     this._productService = productService;
     this._solutionService = solutionService;
 }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommunicationJob"/> class.
        /// </summary>
        /// <param name="configuration">The configuration to use.</param>
        /// <param name="logger">The logger to use.</param>
        /// <param name="communicationDelegate">The Communication delegate to use.</param>
        /// <param name="commEmailDelegate">The Communication Email delegate to use.</param>
        /// <param name="emailQueueService">The email queue service to use.</param>
        /// <param name="dbContext">The db context to use.</param>
        public CommunicationJob(IConfiguration configuration, ILogger <CommunicationJob> logger, ICommunicationDelegate communicationDelegate, ICommunicationEmailDelegate commEmailDelegate, IEmailQueueService emailQueueService, GatewayDbContext dbContext)
        {
            this.configuration         = configuration;
            this.logger                = logger;
            this.communicationDelegate = communicationDelegate;
            this.commEmailDelegate     = commEmailDelegate;
            this.emailQueueService     = emailQueueService;
            this.dbContext             = dbContext;

            IConfigurationSection commEmailJobSection = this.configuration.GetSection("CreateCommEmailsForNewCommunications");

            this.fromEmailAddressHGDonotreply = commEmailJobSection.GetValue <string>("FromEmailAddressHGDonotreply");
            this.maxFetchSize = commEmailJobSection.GetValue <int>("MaxFetchSize", 250);
        }
Example #11
0
 public CheckoutController(IUnitOfWork unitOfWork, ICategoryService categoryService,
     IOrderService orderService, IOrderDetailService orderDetailService,
     ICartService cartService, IEmailQueueService emailQueueService,
     IProductService productService,
     IEmailTemplateService emailTemplateService, IContentService content)
 {
     this._unitOfWork = unitOfWork;
     this._categoryService = categoryService;
     this._productService = productService;
     this._orderService = orderService;
     this._orderDetailService = orderDetailService;
     this._cartService = cartService;
     this._emailQueueService = emailQueueService;
     this._emailTemplateService = emailTemplateService;
     this._content = content;
 }
Example #12
0
 public UserService(IRepository <OrderDetail> OrderDetail, IUnitOfWork UnitOfWork, IRepository <User> User, IRepository <Address> Address, IRepository <Audit> Audit
                    , IRepository <ResellerContract> ResellerContract, IRepository <Contract> Contract, IWBRepository wbrepository
                    , IRepository <EmailTemplates> EmailTemplates, IRepository <EmailQueue> EmailQueue, IEmailQueueService pEmailQueueService, IRepository <UserOptions> pUserOptions)
 {
     _unitOfWork        = UnitOfWork;
     _orderdetail       = OrderDetail;
     _user              = User;
     _address           = Address;
     _audit             = Audit;
     _resellercontract  = ResellerContract;
     _repo              = wbrepository;
     _contract          = Contract;
     _emailtemplates    = EmailTemplates;
     _emailqueue        = EmailQueue;
     _EmailQueueService = pEmailQueueService;
     _useroptions       = pUserOptions;
 }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserEmailService"/> class.
        /// </summary>
        /// <param name="logger">Injected Logger Provider.</param>
        /// <param name="messageVerificationDelegate">The message verification delegate to interact with the DB.</param>
        /// <param name="profileDelegate">The profile delegate to interact with the DB.</param>
        /// <param name="emailQueueService">The email service to queue emails.</param>
        /// <param name="notificationSettingsService">Notification settings delegate.</param>
        /// <param name="configuration">Configuration settings.</param>
        /// <param name="httpContextAccessor">The injected http context accessor provider.</param>
        public UserEmailService(
            ILogger <UserEmailService> logger,
            IMessagingVerificationDelegate messageVerificationDelegate,
            IUserProfileDelegate profileDelegate,
            IEmailQueueService emailQueueService,
            INotificationSettingsService notificationSettingsService,
            IConfiguration configuration,
            IHttpContextAccessor httpContextAccessor)
        {
            this.logger = logger;
            this.messageVerificationDelegate    = messageVerificationDelegate;
            this.profileDelegate                = profileDelegate;
            this.emailQueueService              = emailQueueService;
            this.notificationSettingsService    = notificationSettingsService;
            this.emailVerificationExpirySeconds = configuration.GetSection(this.webClientConfigSection).GetValue <int>(this.emailConfigExpirySecondsKey, 5);

            this.httpContextAccessor = httpContextAccessor;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyUpdatedLegalAgreementsJob"/> class.
 /// </summary>
 /// <param name="configuration">The configuration to use.</param>
 /// <param name="logger">The logger to use.</param>
 /// <param name="applicationSettingsDelegate">The application settings delegate.</param>
 /// <param name="legalAgreementDelegate">The legal agreement delegate.</param>
 /// <param name="profileDelegate">The profile delegate.</param>
 /// <param name="emailService">The email service.</param>
 /// <param name="dbContext">The db context to use.</param>
 public NotifyUpdatedLegalAgreementsJob(
     IConfiguration configuration,
     ILogger <NotifyUpdatedLegalAgreementsJob> logger,
     IApplicationSettingsDelegate applicationSettingsDelegate,
     ILegalAgreementDelegate legalAgreementDelegate,
     IUserProfileDelegate profileDelegate,
     IEmailQueueService emailService,
     GatewayDbContext dbContext)
 {
     this.configuration = configuration;
     this.logger        = logger;
     this.applicationSettingsDelegate = applicationSettingsDelegate;
     this.legalAgreementDelegate      = legalAgreementDelegate;
     this.profileDelegate             = profileDelegate;
     this.emailService     = emailService;
     this.dbContext        = dbContext;
     this.profilesPageSize = this.configuration.GetValue <int>($"{JobKey}:{ProfilesPageSizeKey}");
     this.host             = this.configuration.GetValue <string>($"{HostKey}");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloseAccountJob"/> class.
 /// </summary>
 /// <param name="configuration">The configuration to use.</param>
 /// <param name="logger">The logger to use.</param>
 /// <param name="profileDelegate">The profile delegate.</param>
 /// <param name="emailService">The email service.</param>
 /// <param name="authDelegate">The OAuth2 authentication service.</param>
 /// <param name="userAdminDelegate">The AccessManagement userAdmin delegate.</param>
 /// <param name="dbContext">The db context to use.</param>
 public CloseAccountJob(
     IConfiguration configuration,
     ILogger <CloseAccountJob> logger,
     IUserProfileDelegate profileDelegate,
     IEmailQueueService emailService,
     IAuthenticationDelegate authDelegate,
     IUserAdminDelegate userAdminDelegate,
     GatewayDbContext dbContext)
 {
     this.configuration     = configuration;
     this.logger            = logger;
     this.profileDelegate   = profileDelegate;
     this.emailService      = emailService;
     this.authDelegate      = authDelegate;
     this.userAdminDelegate = userAdminDelegate;
     this.dbContext         = dbContext;
     this.profilesPageSize  = this.configuration.GetValue <int>($"{JobKey}:{ProfilesPageSizeKey}");
     this.host = this.configuration.GetValue <string>($"{HostKey}");
     this.hoursBeforeDeletion = this.configuration.GetValue <int>($"{JobKey}:{HoursDeletionKey}") * -1;
     this.emailTemplate       = this.configuration.GetValue <string>($"{JobKey}:{EmailTemplateKey}");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BetaRequestService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="betaRequestDelegate">The email delegate to interact with the DB.</param>
 /// <param name="emailQueueService">The email service to queue emails.</param>
 public BetaRequestService(ILogger <BetaRequestService> logger, IBetaRequestDelegate betaRequestDelegate, IEmailQueueService emailQueueService)
 {
     this.logger = logger;
     this.betaRequestDelegate = betaRequestDelegate;
     this.emailQueueService   = emailQueueService;
 }
Example #17
0
        private void InsertUpdateDataAndSendMail(UserTransaction usertransaction, SupportDetail supportdetail, IEmailQueueService _emailservice)
        {
            supportdetail.SupportRequest.OrderDetail.OrderStatusID = (int)OrderStatus.REFUNDED;

            var _usertransaction = DependencyResolver.Current.GetService <IRepository <UserTransaction> >();

            usertransaction.AuditDetails      = new Audit();
            usertransaction.AuditDetails      = supportdetail.AuditDetails;
            usertransaction.OrderDetail       = supportdetail.SupportRequest.OrderDetail;
            usertransaction.OrderDetailID     = supportdetail.SupportRequest.OrderDetail.ID;
            usertransaction.RefundRequest     = supportdetail.SupportRequest;
            usertransaction.RefundRequestID   = supportdetail.SupportRequest.ID;
            usertransaction.SiteID            = Site.ID;
            usertransaction.TransactionModeID = (int)TransactionMode.REFUND;
            usertransaction.UserID            = supportdetail.SupportRequest.UserID;

            _usertransaction.Add(usertransaction);
            _service.Add(supportdetail);
            _unitOfWork.Commit();


            usertransaction.OrderDetail.InvoiceNumber = InvoicePrefix + usertransaction.OrderDetail.OrderID;

            if (usertransaction.User.UserType == UserType.RESELLER)
            {
                _emailservice.PrepareEmailQueue(Site.ID, LangID, EmailType.RESELLER_REFUND_NOTIFICATION, SMTPID, usertransaction.User.Email, usertransaction);
            }
            else
            {
                _emailservice.PrepareEmailQueue(Site.ID, LangID, EmailType.CUSTOMER_REFUND_NOTIFICATION, SMTPID, usertransaction.User.Email, usertransaction);
            }

            _emailservice.PrepareEmailQueue(Site.ID, LangID, EmailType.ADMIN_REFUND_NOTIFICATION, SMTPID, SiteAdminEmail, supportdetail);
            _unitOfWork.Commit();
        }
Example #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthRepository" /> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="emailQueueService">The email queue service.</param>
 /// <param name="refreshToken">The refresh token.</param>
 /// <param name="userManager">The user manager.</param>
 /// <param name="roles">The roles.</param>
 /// <param name="mapperFactory">The mapper factory.</param>
 /// <param name="crmManagerService">The CRMManager service.</param>
 /// <param name="commonService"> the commonService</param>
 public AuthRepository(
     IRepository<AuthClients> client,
     IEmailQueueService emailQueueService,
     IRepository<RefreshAuthTokens> refreshToken,
     UserManager<ApplicationUser> userManager,
     IRepository<IdentityRole> roles,
     IMapperFactory mapperFactory,
     ICRMManagerService crmManagerService,
     ICommonService commonService)
 {
     this.client = client;
     this.refreshToken = refreshToken;
     this.userManager = userManager;
     this.roles = roles;
     this.emailQueueService = emailQueueService;
     this.mapperFactory = mapperFactory;
     this.crmManagerService = crmManagerService;
     this.commonService = commonService;
     userManager.UserValidator = new UserValidator<ApplicationUser>(userManager) { AllowOnlyAlphanumericUserNames = false };
     userManager.EmailService = new EmailService();
 }