public static List<StockDay> ParseData(DataProviders dp, string data)
 {
     switch(dp)
     {
         case DataProviders.YahooFinance:
             return ParseDataYahooFinance(data);
         default:
             throw new DataProviderNotValidException();
     }
 }
 public SqlFragment(DataProviders.IDataProvider provider)
 {
     switch (provider.Client)
     {
         case SubSonic.DataProviders.DataClient.SqlClient:
             this.LEFT_INNER_JOIN = this.LEFT_JOIN;  //MSSQL Doesn't like standard left join syntax.
             this.RIGHT_INNER_JOIN = this.RIGHT_JOIN;
             break;
     }
 }
 public static string RetrieveData(DataProviders dp, DateTime StartDate, DateTime EndDate, string Company)
 {
     switch (dp)
     {
         case DataProviders.YahooFinance:
             return RetrieveYahooFinanceData(StartDate, EndDate, Company);
         default:
             throw new DataProviderNotValidException();
     }
 }
Example #4
0
 public IDataProvider <T> DataProvider <T>()
 {
     return((IDataProvider <T>)DataProviders.First(dataProvider => dataProvider.GetType().GenericTypeArguments[0] == typeof(T)));
 }
Example #5
0
 private DBContext(DataProviders provider, IDBConnectionStringProvider CSProvider)
 {
     _provider   = provider;
     _CSProvider = CSProvider;
 }
Example #6
0
 public override DatabaseQueries GenerateDatabase(DataProviders provider)
 {
     return(base.GenerateDatabase(provider));
 }
Example #7
0
 public override DatabaseQueries GenerateDatabase(DataCollectionObject importedForm, DataProviders provider)
 {
     return(base.GenerateDatabase(importedForm, provider));
 }
Example #8
0
        /// <summary>
        /// Responsible for processing all FRS services
        /// </summary>
        public ExecuteSql()
        {
            DataProviders.Add(SOURCE_PROVIDER_KEY, null);

            ConfigurationArguments.Add(CONFIG_COMMAND_TIMEOUT_KEY, null);
        }
        public AQSGetRawData()
        {
            ConfigurationArguments.Add(CONFIG_PARAM_ACTION_CODES, null);

            DataProviders.Add(SOURCE_PROVIDER_KEY, null);
        }
 static CommentMasterDataProvider()
 {
     CommentMasterDataProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.AccountCenter.Data.CommentData,Hidistro.AccountCenter.Data") as CommentMasterDataProvider);
 }
Example #11
0
        public override bool FromMetadata(IDictionary <Guid, IList <MediaItemAspect> > aspectData)
        {
            if (!aspectData.ContainsKey(TempSubtitleAspect.ASPECT_ID) && !aspectData.ContainsKey(EpisodeAspect.ASPECT_ID) && !aspectData.ContainsKey(MovieAspect.ASPECT_ID))
            {
                return(false);
            }

            if (MediaItemAspect.TryGetAspect(aspectData, EpisodeAspect.Metadata, out var episodeAspect))
            {
                IEnumerable collection;
                if (MediaItemAspect.TryGetAttribute(aspectData, EpisodeAspect.ATTR_EPISODE, out collection))
                {
                    Episode = collection.Cast <int>().Distinct().First();
                }

                Season     = episodeAspect.GetAttributeValue <int>(EpisodeAspect.ATTR_SEASON);
                MediaTitle = episodeAspect.GetAttributeValue <string>(EpisodeAspect.ATTR_SERIES_NAME);
            }
            else if (MediaItemAspect.TryGetAspect(aspectData, MovieAspect.Metadata, out var movieAspect))
            {
                MediaTitle = movieAspect.GetAttributeValue <string>(MovieAspect.ATTR_MOVIE_NAME);
                if (MediaItemAspect.TryGetAttribute(aspectData, MediaAspect.ATTR_RECORDINGTIME, out DateTime release))
                {
                    Year = release.Year;
                }
            }
            else if (MediaItemAspect.TryGetAspect(aspectData, MediaAspect.Metadata, out var mediaAspect))
            {
                MediaTitle = mediaAspect.GetAttributeValue <string>(MediaAspect.ATTR_TITLE);
            }

            if (MediaItemAspect.TryGetAspect(aspectData, TempSubtitleAspect.Metadata, out var subAspect))
            {
                Name        = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_NAME);
                DisplayName = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_DISPLAY_NAME);
                SubtitleId  = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_SUBTITLEID);
                Language    = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_LANGUAGE);

                DataProviders.Clear();
                var dataProviders = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_PROVIDER);
                if (dataProviders?.Count() > 0)
                {
                    DataProviders = new List <string>(dataProviders.Split(';'));
                }

                Categories.Clear();
                var categories = subAspect.GetAttributeValue <string>(TempSubtitleAspect.ATTR_CATEGORY);
                if (categories?.Count() > 0)
                {
                    Categories = new List <string>(categories.Split(';'));
                }
            }

            MediaFiles.Clear();
            if (aspectData.ContainsKey(ProviderResourceAspect.ASPECT_ID))
            {
                IList <MultipleMediaItemAspect> resourceAspects;
                if (MediaItemAspect.TryGetAspects(aspectData, ProviderResourceAspect.Metadata, out resourceAspects))
                {
                    foreach (MultipleMediaItemAspect resourceAspect in resourceAspects)
                    {
                        string systemId = resourceAspect.GetAttributeValue <string>(ProviderResourceAspect.ATTR_SYSTEM_ID);
                        string path     = resourceAspect.GetAttributeValue <string>(ProviderResourceAspect.ATTR_RESOURCE_ACCESSOR_PATH);
                        int    type     = resourceAspect.GetAttributeValue <int>(ProviderResourceAspect.ATTR_TYPE);
                        if (type == ProviderResourceAspect.TYPE_PRIMARY)
                        {
                            MediaFiles.Add(new ResourceLocator(systemId, ResourcePath.Deserialize(path)));
                        }
                    }
                }
            }

            return(true);
        }
Example #12
0
 static CommentsProvider()
 {
     CommentsProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.ControlPanel.Data.CommentData,Hidistro.ControlPanel.Data") as CommentsProvider);
 }
Example #13
0
 public GetHEREWqx()
 {
     DataProviders.Remove(DataSourceParameterType.SourceDatabaseDataSource.ToString());
 }
        ///<inheritdoc/>
        protected override void PerformPreLayout()
        {
            base.PerformPreLayout();
            string        layoutStyle   = (string)Handler.GetValue(GENERAL, LAYOUT_STYLE);
            IDataProvider customGroupDP = CurrentLayoutGraph.GetDataProvider(CircularLayout.CustomGroupsDpKey);

            if (layoutStyle.Equals(CUSTOM_GROUPS) && customGroupDP == null)
            {
                IDataProvider groupInfoDP = CurrentLayoutGraph.GetDataProvider(GroupingKeys.ParentNodeIdDpKey);
                if (groupInfoDP == null)
                {
                    //Set up dummy data provider for custom group layout style.
                    CurrentLayoutGraph.AddDataProvider(CircularLayout.CustomGroupsDpKey, DataProviders.CreateConstantDataProvider(null));
                }
                else
                {
                    // use existing group info
                    CurrentLayoutGraph.AddDataProvider(CircularLayout.CustomGroupsDpKey, groupInfoDP);
                }
            }
        }
Example #15
0
 public FACIDPluginBase()
 {
     DataProviders.Add(SOURCE_PROVIDER_KEY, null);
 }
Example #16
0
 static MemberRoleProvider()
 {
     MemberRoleProvider._defaultInstance = (DataProviders.CreateInstance("EcShop.Membership.Data.RoleData,EcShop.Membership.Data") as MemberRoleProvider);
 }
Example #17
0
 static MemberRoleProvider()
 {
     MemberRoleProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.Membership.Data.RoleData,Hidistro.Membership.Data") as MemberRoleProvider);
 }
Example #18
0
        /// <summary>
        /// Attempts to call the open fileName method for any IDataProvider plugin that matches the extension on the string.
        /// </summary>
        /// <param name="fileName">A String fileName to attempt to open.</param>
        /// <param name="inRam">A boolean value that if true will attempt to force a load of the data into memory. This value overrides the property on this DataManager.</param>
        /// <param name="progressHandler">Specifies the progressHandler to receive progress messages. This value overrides the property on this DataManager.</param>
        /// <param name="providerName">Name of the provider that should be used for opening. If it is not set or the provider can't open the file, DS takes the first provider that can open the file.</param>
        /// <returns>The opened IDataSet.</returns>
        public virtual IDataSet OpenFile(string fileName, bool inRam, IProgressHandler progressHandler, string providerName = "")
        {
            string ext = Path.GetExtension(fileName)?.ToLower();

            if (ext != null)
            {
                IDataSet result;

                if (providerName != string.Empty)
                {
                    // if a provider name was given we try to find this provider and use it to open the file
                    var provider = PreferredProviders.FirstOrDefault(kvp => kvp.Value.Name == providerName);
                    if (provider.Value != null)
                    {
                        if (GetSupportedExtensions(provider.Value.DialogReadFilter).Contains(ext))
                        {
                            result = provider.Value.Open(fileName);
                            if (result != null)
                            {
                                return(result);
                            }
                        }
                    }

                    var dp = DataProviders.FirstOrDefault(kvp => kvp.Name == providerName);
                    if (dp != null)
                    {
                        if (GetSupportedExtensions(dp.DialogReadFilter).Contains(ext))
                        {
                            result = dp.Open(fileName);
                            if (result != null)
                            {
                                return(result);
                            }
                        }
                    }
                }

                // Check for the extension in the preferred plugins list
                if (PreferredProviders.ContainsKey(ext))
                {
                    result = PreferredProviders[ext].Open(fileName);
                    if (result != null)
                    {
                        return(result);
                    }

                    // if we get here, we found the provider, but it did not succeed in opening the file.
                }

                // Check the general list of developer specified providers... but not the directory providers
                foreach (IDataProvider dp in DataProviders)
                {
                    if (!GetSupportedExtensions(dp.DialogReadFilter).Contains(ext))
                    {
                        continue;
                    }

                    // attempt to open with the fileName.
                    dp.ProgressHandler = ProgressHandler;

                    result = dp.Open(fileName);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            throw new ApplicationException(DataStrings.FileTypeNotSupported);
        }
Example #19
0
 void Application_BeginRequest(object sender, EventArgs e)
 {
     DataProviders.Init();
 }
        private async void btnClone_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(cbxFromDb.Text) && !string.IsNullOrWhiteSpace(cbxToDb.Text) && cbxFromDb.Text != cbxToDb.Text)
            {
                try
                {
                    if (DataProviders.ConfirmDialog($"Clone database '{cbxFromDb.Text}' to '{cbxToDb.Text}', with drop option {(chkbDrop.Checked ? "TRUE" : "FALSE")}"))
                    {
                        cbxFromDb.Enabled = cbxToDb.Enabled = btnClone.Enabled = false;
                        var config = Program.AppConfiguration;
                        FromDb = new MongoDbContext(connectionString: config.DbConnections[cbxFromDb.Text] ?? MongoDbContext.LocalConnection);
                        ToDb   = new MongoDbContext(connectionString: config.DbConnections[cbxToDb.Text] ?? MongoDbContext.LocalConnection);
                        if (chkbDrop.Checked)
                        {
                            await ToDb.Drop();

                            if ((await FromDb.BotCollection.CountDocumentsAsync(x => true)) > 0)
                            {
                                await ToDb.BotCollection.InsertManyAsync(await FromDb.BotCollection.Find(x => true).ToListAsync());
                            }
                        }
                        var fromBotConfiguration = await FromDb.BotCollection.FindOneById(MongoDbContext.BotAlphaName);

                        if (chkbSelectProfile.Checked)
                        {
                            if (!chkbDrop.Checked)
                            {
                                var chatProfile = fromBotConfiguration.Configuration.ChatProfiles.FirstOrDefault(x => x.Name == cbxChatProfile.Text);
                                await ToDb.BotCollection.AddOrUpdateChatProfileById(MongoDbContext.BotAlphaName, chatProfile);

                                var toBotConfiguration = await ToDb.BotCollection.FindOneById(MongoDbContext.BotAlphaName);

                                var tempList = new List <KeyValuePair <string, string> >();
                                fromBotConfiguration.Configuration?.ResourceStrings?.ForEach(str =>
                                {
                                    var search = (KeyValuePair <string, string>)toBotConfiguration.Configuration?.ResourceStrings.FirstOrDefault(res => res.Key == str.Key);
                                    if (string.IsNullOrWhiteSpace(search.Key))
                                    {
                                        tempList.Add(str);
                                    }
                                });

                                if (tempList.Count > 0)
                                {
                                    await ToDb.BotCollection.AddStringResourceBatchById(MongoDbContext.BotAlphaName, tempList);
                                }
                            }

                            FromDb.SyncChatProfile(cbxChatProfile.Text);
                            ToDb.SyncChatProfile(cbxChatProfile.Text);
                            await ToDb.DropAllNodeCollections();
                            await CopyDb();
                        }
                        else
                        {
                            foreach (var profile in fromBotConfiguration?.Configuration?.ChatProfiles)
                            {
                                FromDb.SyncChatProfile(profile.Name);
                                ToDb.SyncChatProfile(profile.Name);
                                await CopyDb();
                            }
                        }
                        DialogResult      = DialogResult.OK;
                        cbxFromDb.Enabled = cbxToDb.Enabled = btnClone.Enabled = true;

                        MessageBox.Show("Operation completed without any error.", "Clone confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    if (DialogResult == DialogResult.OK)
                    {
                        this.Close();
                    }
                }
            }
        }
 public GetTRISubmitManifest()
 {
     DataProviders.Add(SOURCE_PROVIDER_KEY, null);
 }
Example #22
0
 public XmlFileImporter()
 {
     DataProviders.Add(DESTINATION_PROVIDER_KEY, null);
 }
Example #23
0
 static PromotionsProvider()
 {
     PromotionsProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.ControlPanel.Data.PromotionData,Hidistro.ControlPanel.Data") as PromotionsProvider);
 }
Example #24
0
 static ShoppingSubsiteProvider()
 {
     ShoppingSubsiteProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.SaleSystem.DistributionData.ShoppingData,Hidistro.SaleSystem.DistributionData") as ShoppingSubsiteProvider);
 }
Example #25
0
 public override DatabaseQueries CreateTable(DataProviders provider, string tableScript)
 {
     return(base.CreateTable(provider, tableScript));
 }
Example #26
0
 static SubsiteProductProvider()
 {
     SubsiteProductProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.Subsites.Data.ProductData,Hidistro.Subsites.Data") as SubsiteProductProvider);
 }
Example #27
0
 public override DatabaseQueries GenerateDatabase(DataCollectionObject importedForm, bool checkForeignKeys, DataProviders provider)
 {
     return(base.GenerateDatabase(importedForm, checkForeignKeys, provider));
 }
Example #28
0
        public void GetProviders()
        {
            DataProviders providers = _hibernateProvider.GetProviders();

            Assert.AreNotEqual(0, providers.Count);
        }
Example #29
0
 static TradeSubsiteProvider()
 {
     TradeSubsiteProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.AccountCenter.DistributionData.BusinessData,Hidistro.AccountCenter.DistributionData") as TradeSubsiteProvider);
 }
 public static string RetrieveData(DataProviders dp, DateTime StartDate, string Company)
 {
     return RetrieveData(dp, StartDate, DateTime.Now, Company);
 }
Example #31
0
 static OpenIdProvider()
 {
     OpenIdProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.Subsites.Data.OpenIdData,Hidistro.Subsites.Data") as OpenIdProvider);
 }
Example #32
0
 public ConnectionStringBuilder(string dataSource, DataProviders provider) : this(dataSource, provider.Name())
 {
 }
Example #33
0
 static ControlProvider()
 {
     ControlProvider._defaultInstance = (DataProviders.CreateInstance("EcShop.UI.Common.Data.SqlCommonDataProvider, EcShop.UI.Common.Data") as ControlProvider);
 }
Example #34
0
 static ProductMasterProvider()
 {
     ProductMasterProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.SaleSystem.Data.ProductData,Hidistro.SaleSystem.Data") as ProductMasterProvider);
 }