/// <summary>
        /// Populate harvest job information object with data provider meta data by the data reader.
        /// </summary>
        /// <param name="harvestJob">Harvest job.</param>
        /// <param name="dataReader">Database reader.</param>
        public static void LoadHarvestJobDataProviders(this HarvestJob harvestJob, ArtDatabanken.Database.DataReader dataReader)
        {
            HarvestJobDataProvider harvestJobDataProvider = new HarvestJobDataProvider()
            {
                DataProviderId = dataReader.GetInt32(HarvestJobTableData.DATAPROVIDERID),
                ChangeId       = dataReader.GetInt64(HarvestJobTableData.CHANGEID, -1)
            };

            harvestJob.DataProviders.Add(harvestJobDataProvider);
        }
        /// <summary>
        /// Populate harvest job information object with harvest job meta data by the data reader.
        /// </summary>
        /// <param name="harvestJob">Harvest job.</param>
        /// <param name="dataReader">Database reader.</param>
        public static void LoadHarvestJobStatistics(this HarvestJob harvestJob, ArtDatabanken.Database.DataReader dataReader)
        {
            HarvestJobStatistic harvestJobStatistic = new HarvestJobStatistic()
            {
                DataProviderId = dataReader.GetInt32(HarvestJobTableData.DATAPROVIDERID),
                ChangeId       = -1,
                JobStatus      = (HarvestStatusEnum)Enum.Parse(typeof(HarvestStatusEnum), dataReader.GetString(HarvestJobTableData.JOBSTATUS), true),
                HarvestDate    = dataReader.GetDateTime(HarvestJobTableData.HARVESTDATE, DateTime.MinValue)
            };

            harvestJob.Statistics.Add(harvestJobStatistic);
        }
示例#3
0
 /// <summary>
 /// Populate taxon tree information object with parent and child taxon id by the data reader.
 /// </summary>
 /// <param name="taxonTreeInformation">Taxon tree information.</param>
 /// <param name="dataReader">Database reader.</param>
 public static void Load(this TaxonTreeInformation taxonTreeInformation, ArtDatabanken.Database.DataReader dataReader)
 {
     taxonTreeInformation.ParentTaxonId = dataReader.GetInt32("ParentTaxonId", 0);
     taxonTreeInformation.ChildTaxonId  = dataReader.GetInt32("ChildTaxonId", 0);
 }