private void InitProvider() { Guid _providerId = MailingUtilities.GetActiveProviderId(UserConnection); SysMailingProvider provider = GetProvider(_providerId); if (provider == null) { string msg = string.Format("Could not load provider data from DB. Provider UId: {0}", _providerId); throw new Exception(msg); } Type providerType = Type.GetType(provider.ClassName); if (providerType != null) { IMailingProviderConfigFactory configFactory = CreateConfigFactory(provider.ConfigFactoryClassName); _mailingProvider = CreateProviderInstance(providerType, configFactory); var configurableProvider = _mailingProvider as IConfigurableMailingProvider; if (configurableProvider != null) { configurableProvider.Configure(); } } else { string msg = string.Format("Could not initiate provider instance. Provider UId: {0}", _providerId); throw new Exception(msg); } }
private SysMailingProvider GetProvider(Guid providerId) { SysMailingProvider provider = new SysMailingProvider(UserConnection); if (!provider.FetchFromDB(providerId)) { return(null); } return(provider); }
public SysMailingProvider(SysMailingProvider source) : base(source) { }