Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_userManager != null)
                {
                    _userManager.Dispose();
                    _userManager = null;
                }

                if (_signInManager != null)
                {
                    _signInManager.Dispose();
                    _signInManager = null;
                }

                if (_roleManager != null)
                {
                    _roleManager.Dispose();
                    _roleManager = null;
                }
                if (_logger != null)
                {
                    _logger.Dispose();
                    _logger = null;
                }
                if (_smtp != null)
                {
                    _smtp.Dispose();
                    _smtp = null;
                }
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
        public SMTPServiceDetails GetSMTPServiceDetails(SMTPProvider smtpProvider = SMTPProvider.external)
        {
            SMTPServiceDetails smtpDetails;
            string             from = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["fromError"]);
            string             to   = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["toError"]);

            if (smtpProvider == SMTPProvider.local)
            {
                return smtpDetails = new SMTPServiceDetails
                {
                           host     = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SmtpLocalHost"]),
                           port     = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpLocalPort"]),
                           username = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SmtpLocalUsername"]),
                           password = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SmtpLocalPassword"]),
                           from     = from,
                           to       = to,
                           useDefaultCredentials = true
                }
            }
            ;

            return(smtpDetails = new SMTPServiceDetails
            {
                host = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["host"]),
                port = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["port"]),
                username = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["username"]),
                password = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["password"]),
                from = from,
                to = to,
                useDefaultCredentials = false
            });
        }
    }
Ejemplo n.º 3
0
 public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager, CoreLoggerProvider logger, SMTPProvider smtp)
 {
     UserManager   = userManager;
     SignInManager = signInManager;
     RoleManager   = roleManager;
     Logger        = logger;
     SMTP          = smtp;
 }
 protected override void SetProvider()
 {
     _provider = new SMTPProvider <CampaignContent>();
 }
 public BusinessAdminController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager, CoreLoggerProvider logger, SMTPProvider smtp, BusinessProvider provider)
 {
     UserManager   = userManager;
     SignInManager = signInManager;
     RoleManager   = roleManager;
     Logger        = logger;
     Provider      = provider;
 }