Exemple #1
0
 public static void ToDownloadDefinition(NpgsqlDataReader reader, DataPumpDownloadDefinition data)
 {
     data.Type          = (StockType)reader.GetFieldValue <int>(reader.GetOrdinal("typ"));
     data.PathDaily     = GetStringOrEmpty(reader, "path_dzienne");
     data.FileNameDaily = GetStringOrEmpty(reader, "file_dzienne");
     data.PathIntra     = GetStringOrEmpty(reader, "path_intra");
 }
Exemple #2
0
        public Dictionary <StockType, DataPumpDownloadDefinition> GetDownloadDefinitions()
        {
            Dictionary <StockType, DataPumpDownloadDefinition> res = new Dictionary <StockType, DataPumpDownloadDefinition>();

            string qry = $"select * from bossa_downloadurls order by typ";

            ProcessSelectQuery(qry, (reader) =>
            {
                if (!reader.HasRows)
                {
                    return;
                }
                while (reader.Read())
                {
                    DataPumpDownloadDefinition def = new DataPumpDownloadDefinition();
                    PgDataToDownloadDefinitionConverter.ToDownloadDefinition(reader, def);
                    res.Add(def.Type, def);
                }
            });
            return(res);
        }