protected BaseConfiguration()
        {
            ProviderCollection <StorageProviderDefinition> storageProviderDefinitionCollection = StorageProviderDefinitionObjectMother.CreateTestDomainStorageProviders();

            _storageConfiguration = new StorageConfiguration(
                storageProviderDefinitionCollection,
                storageProviderDefinitionCollection[DatabaseTest.DefaultStorageProviderID]);

            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new TestDomainAttribute(),
                    DatabaseTest.c_testDomainProviderID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new StorageProviderStubAttribute(),
                    DatabaseTest.c_unitTestStorageProviderStubID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new TableInheritanceTestDomainAttribute(),
                    TableInheritanceMappingTest.TableInheritanceTestDomainProviderID));

            _mappingLoaderConfiguration = new MappingLoaderConfiguration();
            _queryConfiguration         = new QueryConfiguration("QueriesForStandardMapping.xml");

            var typeDiscoveryService = GetTypeDiscoveryService(GetType().Assembly);

            _mappingConfiguration = new MappingConfiguration(
                MappingReflectorObjectMother.CreateMappingReflector(typeDiscoveryService),
                new PersistenceModelLoader(new StorageGroupBasedStorageProviderDefinitionFinder(_storageConfiguration)));
        }
예제 #2
0
        internal static AppConfig CreateAppConfig(
            string invariantName = null, string typeName = null, string sqlGeneratorName = null, string spatialProviderType = null)
        {
            var mockEFSection = new Mock <EntityFrameworkSection>();

            mockEFSection.Setup(m => m.DefaultConnectionFactory).Returns(new DefaultConnectionFactoryElement());
            mockEFSection.Setup(m => m.SpatialProviderTypeName).Returns(spatialProviderType);

            var providers = new ProviderCollection();

            if (!string.IsNullOrEmpty(invariantName))
            {
                var providerElement = providers.AddProvider(invariantName, typeName);
                if (sqlGeneratorName != null)
                {
                    providerElement.SqlGeneratorElement = new MigrationSqlGeneratorElement
                    {
                        SqlGeneratorTypeName = sqlGeneratorName
                    };
                }
            }
            mockEFSection.Setup(m => m.Providers).Returns(providers);

            return(new AppConfig(new ConnectionStringSettingsCollection(), null, mockEFSection.Object));
        }
예제 #3
0
        public static void Initialize()
        {
            ProviderCollection <StorageProviderDefinition> providers = new ProviderCollection <StorageProviderDefinition>();

            providers.Add(new RdbmsProviderDefinition("PerformanceTestDomain", new SqlStorageObjectFactory(), ConnectionString));
            StorageConfiguration storageConfiguration = new StorageConfiguration(providers, providers["PerformanceTestDomain"]);

            DomainObjectsConfiguration.SetCurrent(new FakeDomainObjectsConfiguration(storage: storageConfiguration));


            var rootAssemblyFinder = new FixedRootAssemblyFinder(new RootAssembly(typeof(StandardConfiguration).Assembly, true));
            var assemblyLoader     = new FilteringAssemblyLoader(ApplicationAssemblyLoaderFilter.Instance);
            var assemblyFinder     = new CachingAssemblyFinderDecorator(new AssemblyFinder(rootAssemblyFinder, assemblyLoader));
            ITypeDiscoveryService typeDiscoveryService = new AssemblyFinderTypeDiscoveryService(assemblyFinder);
            MappingConfiguration  mappingConfiguration = new MappingConfiguration(
                new MappingReflector(
                    typeDiscoveryService,
                    new ClassIDProvider(),
                    new ReflectionBasedMemberInformationNameResolver(),
                    new PropertyMetadataReflector(),
                    new DomainModelConstraintProvider(),
                    MappingReflector.CreateDomainObjectCreator()),
                new PersistenceModelLoader(new StorageGroupBasedStorageProviderDefinitionFinder(DomainObjectsConfiguration.Current.Storage)));

            MappingConfiguration.SetCurrent(mappingConfiguration);
        }
예제 #4
0
 public ProviderCollection FetchAll()
 {
     ProviderCollection coll = new ProviderCollection();
     Query qry = new Query(Provider.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
예제 #5
0
        public static ProviderCollection <StorageProviderDefinition> CreateTestDomainStorageProviders()
        {
            ProviderCollection <StorageProviderDefinition> storageProviderDefinitionCollection = new ProviderCollection <StorageProviderDefinition>();
            var sqlStorageObjectFactory = new SqlStorageObjectFactory();

            storageProviderDefinitionCollection.Add(
                new RdbmsProviderDefinition(
                    DatabaseTest.c_testDomainProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.TestDomainConnectionString));

            storageProviderDefinitionCollection.Add(
                new RdbmsProviderDefinition(
                    DatabaseTest.DefaultStorageProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.TestDomainConnectionString));

            storageProviderDefinitionCollection.Add(
                new UnitTestStorageProviderStubDefinition(
                    DatabaseTest.c_unitTestStorageProviderStubID));

            storageProviderDefinitionCollection.Add(
                new RdbmsProviderDefinition(
                    TableInheritanceMappingTest.TableInheritanceTestDomainProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.TestDomainConnectionString));

            return(storageProviderDefinitionCollection);
        }
        protected TestMappingConfiguration()
        {
            ProviderCollection <StorageProviderDefinition> storageProviderDefinitionCollection = StorageProviderDefinitionObjectMother.CreateTestDomainStorageProviders();

            _storageConfiguration = new StorageConfiguration(
                storageProviderDefinitionCollection, storageProviderDefinitionCollection[MappingReflectionTestBase.DefaultStorageProviderID]);
            _storageConfiguration.StorageGroups.Add(new StorageGroupElement(new TestDomainAttribute(), MappingReflectionTestBase.c_testDomainProviderID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(new StorageProviderStubAttribute(), MappingReflectionTestBase.c_unitTestStorageProviderStubID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(new TableInheritanceTestDomainAttribute(), TableInheritanceMappingTest.TableInheritanceTestDomainProviderID));

            _mappingLoaderConfiguration = new MappingLoaderConfiguration();
            _queryConfiguration         = new QueryConfiguration("QueriesForStandardMapping.xml");
            DomainObjectsConfiguration.SetCurrent(
                new FakeDomainObjectsConfiguration(_mappingLoaderConfiguration, _storageConfiguration, _queryConfiguration));

            var typeDiscoveryService = GetTypeDiscoveryService();

            _mappingConfiguration = new MappingConfiguration(
                MappingReflectorObjectMother.CreateMappingReflector(typeDiscoveryService),
                new PersistenceModelLoader(new StorageGroupBasedStorageProviderDefinitionFinder(DomainObjectsConfiguration.Current.Storage)));
            MappingConfiguration.SetCurrent(_mappingConfiguration);

            _domainObjectIDs = new DomainObjectIDs();
        }
        public async Task RegisterEmptyException()
        {
            ProviderCollection  providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();
            Response <Provider> response           = await providerCollection.GetAsync("microsoft.insights");

            Assert.ThrowsAsync <RequestFailedException>(async() => { await response.Value.RegisterAsync(""); });
        }
        public async Task UnregisterNullException()
        {
            ProviderCollection  providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();
            Response <Provider> response           = await providerCollection.GetAsync("microsoft.insights");

            Assert.ThrowsAsync <ArgumentNullException>(async() => { await response.Value.UnregisterAsync(null); });
        }
예제 #9
0
        protected override void OnStart(string[] args)
        {
            var tasks = new ProviderCollection <WorkerRoleTask>(typeof(WorkerRole));

            workerRole_ = new WorkerRole(tasks);
            workerRole_.OnStart();
        }
예제 #10
0
        /// <summary>
        /// Fetches the type of the by provider.
        /// </summary>
        /// <param name="providerType">Type of the provider.</param>
        /// <returns></returns>
        public ProviderCollection FetchByProviderType(ProviderType providerType)
        {
            ProviderCollection providerCollection = new ProviderCollection().
                                                    Where(Provider.Columns.ProviderTypeId, providerType).OrderByAsc(NAME).Load();

            return(providerCollection);
        }
예제 #11
0
        public void SetUp()
        {
            try
            {
                var providers = new ProviderCollection <StorageProviderDefinition>();
                providers.Add(new RdbmsProviderDefinition("TheStorageProvider", new SqlStorageObjectFactory(), TestDomainConnectionString));
                var storageConfiguration = new StorageConfiguration(providers, providers["TheStorageProvider"]);

                DomainObjectsConfiguration.SetCurrent(new FakeDomainObjectsConfiguration(storage: storageConfiguration));

                SqlConnection.ClearAllPools();

                var scriptGenerator = new ScriptGenerator(
                    pd => pd.Factory.CreateSchemaScriptBuilder(pd),
                    new RdbmsStorageEntityDefinitionProvider(),
                    new ScriptToStringConverter());
                var scripts = scriptGenerator.GetScripts(MappingConfiguration.Current.GetTypeDefinitions()).Single();

                var masterAgent = new DatabaseAgent(MasterConnectionString);
                masterAgent.ExecuteBatchFile("Database\\CreateDB.sql", false, DatabaseConfiguration.GetReplacementDictionary());

                var databaseAgent = new DatabaseAgent(TestDomainConnectionString);
                databaseAgent.ExecuteBatchString(scripts.SetUpScript, true);
            }
            catch (Exception e)
            {
                Console.WriteLine("SetUpFixture failed: " + e);
                Console.WriteLine();
                throw;
            }
        }
예제 #12
0
 public new void InstantiateProviders(
     ProviderSettingsCollection providerSettingsCollection,
     ProviderCollection providerCollection,
     Type providerType,
     params Type[] providerInterfaces)
 {
     base.InstantiateProviders(providerSettingsCollection, providerCollection, providerType, providerInterfaces);
 }
예제 #13
0
 /// <summary>
 /// Instantiates the providers.
 /// </summary>
 /// <param name="configProviders">
 /// The config providers.
 /// </param>
 /// <param name="providers">
 /// The providers.
 /// </param>
 /// <param name="provType">
 /// Type of the prov.
 /// </param>
 /// <remarks>
 /// </remarks>
 public static void InstantiateProviders(
     ProviderCollection configProviders, ref ProviderCollection providers, Type provType)
 {
     foreach (ProviderSettings providerSettings in configProviders)
     {
         providers.Add(InstantiateProvider(providerSettings, provType));
     }
 }
예제 #14
0
 /// <summary>
 ///
 /// </summary>
 public static void Instantiate(
     Config.DataAccessSection config, ProviderCollection providers, Type providerType)
 {
     foreach (ProviderSettings settings in config.Providers)
     {
         providers.Add(Instantiate(config, settings, providerType));
     }
 }
예제 #15
0
        private static void Initialize()
        {
            if (_initialized)
            {
                return;
            }

            lock (_initializeLock)
            {
                if (_initialized)
                {
                    return;
                }

                OnInitializing();

                var searchElement = AdxstudioCrmConfigurationManager.GetCrmSection().Search;

                _enabled = searchElement.Enabled;

                if (_enabled.GetValueOrDefault(false))
                {
                    _providers = new ProviderCollection <SearchProvider>();

                    foreach (ProviderSettings providerSettings in searchElement.Providers)
                    {
                        _providers.Add(InstantiateProvider <SearchProvider>(providerSettings));
                    }

                    _providers.SetReadOnly();

                    if (searchElement.DefaultProvider == null)
                    {
                        throw new ProviderException("Specify a default search provider.");
                    }

                    try
                    {
                        _provider = _providers[searchElement.DefaultProvider];
                    }
                    catch {}

                    if (_provider == null)
                    {
                        var defaultProviderPropertyInformation = searchElement.ElementInformation.Properties["defaultProvider"];

                        const string message = "Default Search Provider could not be found.";

                        throw defaultProviderPropertyInformation == null
                                                        ? (Exception) new ProviderException(message)
                                                        : new ConfigurationErrorsException(message, defaultProviderPropertyInformation.Source, defaultProviderPropertyInformation.LineNumber);
                    }
                }

                _initialized = true;
            }
        }
예제 #16
0
        public async Task Exists()
        {
            ProviderCollection providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();

            Assert.IsTrue(await providerCollection.ExistsAsync("microsoft.insights"));
            var response = await providerCollection.ExistsAsync("DoesNotExist");

            Assert.False(response);
        }
예제 #17
0
        private void ResolveDbType(string fullTypeNameToIDatabaseStrategy)
        {
            // ReSharper disable once PossibleInvalidOperationException
            var firstOrDefault =
                ProviderCollection.Select(s => (KeyValuePair <DbAccessType, string>?)s)
                .FirstOrDefault(s => s.Value.Value == fullTypeNameToIDatabaseStrategy);

            DbAccessType = firstOrDefault == null ? DbAccessType.Unknown : firstOrDefault.Value.Key;
        }
        public CaptchaConfiguration()
        {
            DefaultProvider = DefaultSettings.Name;

            Providers = new ProviderCollection
            {
                InstantiateProvider(DefaultSettings)
            };
        }
예제 #19
0
        public async Task Unregister()
        {
            ProviderCollection  providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();
            Response <Provider> response           = await providerCollection.GetAsync("microsoft.insights");

            var result     = response.Value;
            var unregister = await result.UnregisterAsync();

            Assert.IsNotNull(unregister);
        }
        public void Initialize_WithProviderCollectionAndProvider_Expect()
        {
            StorageProviderDefinition providerDefinition = new RdbmsProviderDefinition(
                "ProviderDefinition", _sqlStorageObjectFactory, "ConnectionString");
            ProviderCollection <StorageProviderDefinition> providers = new ProviderCollection <StorageProviderDefinition>();

            StorageConfiguration configuration = new StorageConfiguration(providers, providerDefinition);

            configuration.StorageProviderDefinitions.Add(providerDefinition);
        }
예제 #21
0
 public ContentManager()
 {
     Providers     = new ProviderCollection();
     resourceCache = new Dictionary <string, LinkedList <IResource> >();
     Loaders       = new List <IResourceLoader>();
     Types         = (
         from assembly in AppDomain.CurrentDomain.GetAssemblies()
         from type in assembly.GetExportedTypes()
         where type.GetInterface("IResource") != null
         select type).ToDictionary(t => t.Name);
 }
        public StorageConfiguration(ProviderCollection <StorageProviderDefinition> providers, StorageProviderDefinition defaultProvider)
            : this()
        {
            ArgumentUtility.CheckNotNull("providers", providers);

            _defaultStorageProviderDefinitionHelper.Provider = defaultProvider;

            ProviderCollection <StorageProviderDefinition> providersCopy = CopyProvidersAsReadOnly(providers);

            _defaultStorageProviderDefinitionHelper.Providers = providersCopy;
        }
예제 #23
0
        public async Task TryGet()
        {
            ProviderCollection providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();
            Provider           provider           = await providerCollection.GetIfExistsAsync("microsoft.insights");

            Assert.IsNotNull(provider);

            var response = await providerCollection.GetIfExistsAsync("DoesNotExist");

            Assert.IsNull(response.Value);
        }
        private ProviderCollection <StorageProviderDefinition> CopyProvidersAsReadOnly(ProviderCollection <StorageProviderDefinition> providers)
        {
            ProviderCollection <StorageProviderDefinition> providersCopy = new ProviderCollection <StorageProviderDefinition>();

            foreach (StorageProviderDefinition provider in providers)
            {
                providersCopy.Add(provider);
            }

            providersCopy.SetReadOnly();
            return(providersCopy);
        }
예제 #25
0
        public void Add_providerbase()
        {
            ProviderCollection col = new ProviderCollection();
            TestProviderBase   provider;

            provider = new TestProviderBase();
            provider.Initialize("test", null);

            col.Add(provider);

            Assert.AreEqual(provider, col["test"], "A1");
        }
예제 #26
0
        public void Add_duplicate()
        {
            ProviderCollection col = new ProviderCollection();
            TestProvider       provider;

            provider = new TestProvider();
            provider.Initialize("test", null);


            col.Add(provider);
            col.Add(provider);
        }
예제 #27
0
        public SchemaGenerationConfiguration()
        {
            var sqlStorageObjectFactory             = new SqlStorageObjectFactory();
            var storageProviderDefinitionCollection = new ProviderCollection <StorageProviderDefinition>
            {
                new RdbmsProviderDefinition(
                    DatabaseTest.SchemaGenerationFirstStorageProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.SchemaGenerationConnectionString1),
                new RdbmsProviderDefinition(
                    DatabaseTest.SchemaGenerationSecondStorageProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.SchemaGenerationConnectionString2),
                new RdbmsProviderDefinition(
                    DatabaseTest.SchemaGenerationThirdStorageProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.SchemaGenerationConnectionString3),
                new RdbmsProviderDefinition(
                    DatabaseTest.SchemaGenerationInternalStorageProviderID,
                    sqlStorageObjectFactory,
                    DatabaseTest.SchemaGenerationConnectionString1)
            };

            _storageConfiguration = new StorageConfiguration(
                storageProviderDefinitionCollection,
                storageProviderDefinitionCollection[DatabaseTest.SchemaGenerationFirstStorageProviderID]);
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new FirstStorageGroupAttribute(),
                    DatabaseTest.SchemaGenerationFirstStorageProviderID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new SecondStorageGroupAttribute(),
                    DatabaseTest.SchemaGenerationSecondStorageProviderID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new ThirdStorageGroupAttribute(),
                    DatabaseTest.SchemaGenerationThirdStorageProviderID));
            _storageConfiguration.StorageGroups.Add(
                new StorageGroupElement(
                    new InternalStorageGroupAttribute(),
                    DatabaseTest.SchemaGenerationInternalStorageProviderID));

            _mappingLoaderConfiguration = new MappingLoaderConfiguration();
            _queryConfiguration         = new QueryConfiguration();

            var typeDiscoveryService = GetTypeDiscoveryService(GetType().Assembly);

            _mappingConfiguration = new MappingConfiguration(
                MappingReflectorObjectMother.CreateMappingReflector(typeDiscoveryService),
                new PersistenceModelLoader(new StorageGroupBasedStorageProviderDefinitionFinder(_storageConfiguration)));
            _domainObjectsConfiguration = new FakeDomainObjectsConfiguration(_mappingLoaderConfiguration, _storageConfiguration, _queryConfiguration);
        }
예제 #28
0
        public async Task Get()
        {
            ProviderCollection  providerCollection = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetProviders();
            Response <Provider> response           = await providerCollection.GetAsync("microsoft.insights");

            Provider result = response.Value;

            Assert.IsNotNull(result);

            var ex = Assert.ThrowsAsync <RequestFailedException>(async() => await Client.GetProvider(result.Data.Id + "x").GetAsync());

            Assert.AreEqual(404, ex.Status);
        }
예제 #29
0
        public void Get_nonexistant()
        {
            ProviderCollection col = new ProviderCollection();
            TestProvider       provider;

            provider = new TestProvider();
            provider.Initialize("test", null);


            col.Add(provider);

            Assert.AreEqual(provider, col["test"], "A1");
            Assert.IsNull(col["test2"], "A2");
        }
예제 #30
0
        //methods
        private static void Initialize()
        {
            if (_initialized)
            {
                if (_initializeException != null)
                {
                    throw _initializeException;
                }
            }
            else
            {
                if (_initializeException != null)
                {
                    throw _initializeException;
                }
                lock (_lock)
                {
                    if (_initialized)
                    {
                        if (_initializeException != null)
                        {
                            throw _initializeException;
                        }
                    }
                    else
                    {
                        try
                        {
                            DataModelSection section = ConfigurationManager.GetSection(SectionName) as DataModelSection;
                            _providers = new ProviderCollection();
                            //fill providers collection
                            foreach (ProviderSettings settings in section.Providers)
                            {
                                _providers.Add(InstantiateProvider(settings, typeof(MetadataProvider)));
                            }
                            _provider = (MetadataProvider)_providers[section.DefaultProvider];

                            _typeMappings = section.TypeMappings;
                        }
                        catch (Exception exception)
                        {
                            _initializeException = exception;
                            throw;
                        }
                        _initialized = true;
                    }
                }
            }
        }
예제 #31
0
        private static Mock <EntityFrameworkSection> CreateMockSectionWithProviders()
        {
            var providers = new ProviderCollection();

            providers.AddProvider("Around.The.World", "Around.The.World.Type");
            providers.AddProvider("One.More.Time", "One.More.Time.Type");
            providers.AddProvider("Robot.Rock", "Robot.Rock.Type");

            var mockSection = new Mock <EntityFrameworkSection>();

            mockSection.Setup(m => m.Providers).Returns(providers);
            mockSection.Setup(m => m.DefaultConnectionFactory).Returns(new DefaultConnectionFactoryElement());

            return(mockSection);
        }
        private void Initialize()
        {
            try
            {

                m_providerCollection = new ProviderCollection();
                ProviderConfigurationSection qc = null;

                bool defaultMode = false;
                //Get the feature's configuration info
                qc = (ProviderConfigurationSection)ConfigurationManager.GetSection("UserManagerProvider");
                if (qc == null)
                {
                    defaultMode = true;
                }
                if (defaultMode)
                {
                    if (SystemConfiguration.ApplicationName == "Example")
                    {
                        m_defaultProvider = new MockProvider();
                    }
                    else
                    {
                        m_defaultProvider = new AspNetProvider();
                    }
                    m_providerCollection.Add(m_defaultProvider);
                }
                else
                {
                    if (qc.DefaultProvider == null || qc.Providers == null || qc.Providers.Count < 1)
                    {
                        throw new System.Configuration.Provider.ProviderException("You must specify a valid default provider.");
                    }

                    //Instantiate the providers
                    ProvidersHelper.InstantiateProviders(qc.Providers, m_providerCollection, typeof(ProviderBase));
                    m_defaultProvider = m_providerCollection[qc.DefaultProvider];
                    if (m_defaultProvider == null)
                    {
                        throw new ConfigurationErrorsException("You must specify a default provider for the feature.",
                            qc.ElementInformation.Properties["defaultProvider"].Source,
                            qc.ElementInformation.Properties["defaultProvider"].LineNumber);
                    }
                }
            }
            catch (Exception ex)
            {
                //initializationException = ex;
                isInitialized = false;
                throw ex;
            }

            isInitialized = true; //error-free initialization
        }
예제 #33
0
 protected override void OnStart(string[] args)
 {
     var tasks = new ProviderCollection<WorkerRoleTask>(typeof(WorkerRole));
     workerRole_ = new WorkerRole(tasks);
     workerRole_.OnStart();
 }
예제 #34
0
 /// <summary>
 /// The primary constructor taking in the tasks to be run in this role.
 /// </summary>
 /// <param name="tasks"></param>
 public WorkerRole(ProviderCollection<WorkerRoleTask> tasks)
     : this()
 {
     _tasks = tasks;
 }
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
     if (this.ProviderType == ProviderType.PaymentProvider) {
       PaymentServiceSettings paymentServiceSettings = PaymentService.FetchConfiguredPaymentProviders();
       if (paymentServiceSettings == null && providerId == 0) {//they haven't selected a provider yet.
     Response.Redirect("~/admin/paymentselection.aspx", true);
       }
     }
     providerCollection = new ProviderController().FetchByProviderType(ProviderType);
     if (!Page.IsPostBack) {
       SetProviderConfiguration();
     }
     SetConfigurationControl();
     SetProviderConfigurationProperties();
       }
       catch(Exception ex) {
     Logger.Error(typeof(providerconfiguration).Name + ".Page_Load", ex);
     MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
예제 #36
0
 public ProviderCollection FetchByQuery(Query qry)
 {
     ProviderCollection coll = new ProviderCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
예제 #37
0
 public ProviderCollection FetchByID(object ProviderId)
 {
     ProviderCollection coll = new ProviderCollection().Where("ProviderId", ProviderId).Load();
     return coll;
 }
 /// <summary>
 /// Fetches the type of the by provider.
 /// </summary>
 /// <param name="providerType">Type of the provider.</param>
 /// <returns></returns>
 public ProviderCollection FetchByProviderType(ProviderType providerType)
 {
     ProviderCollection providerCollection = new ProviderCollection().
     Where(Provider.Columns.ProviderTypeId, providerType).OrderByAsc(NAME).Load();
       return providerCollection;
 }
예제 #39
0
        protected StorageConfiguration GetPersistenceConfiguration()
        {
            StorageConfiguration storageConfiguration = DomainObjectsConfiguration.Current.Storage;
              if (storageConfiguration.DefaultStorageProviderDefinition == null)
              {
            ProviderCollection<StorageProviderDefinition> storageProviderDefinitionCollection = new ProviderCollection<StorageProviderDefinition> ();
            RdbmsProviderDefinition providerDefinition = new RdbmsProviderDefinition ("Default", new SqlStorageObjectFactory (), "Initial Catalog=DatabaseName;");
            storageProviderDefinitionCollection.Add (providerDefinition);

            storageConfiguration = new StorageConfiguration (storageProviderDefinitionCollection, providerDefinition);
              }

              return storageConfiguration;
        }