/// <summary>
 /// Populate harvest job information object with meta data by the data reader.
 /// </summary>
 /// <param name="harvestJob">Harvest job.</param>
 /// <param name="dataReader">Database reader.</param>
 public static void LoadHarvestJob(this HarvestJob harvestJob, ArtDatabanken.Database.DataReader dataReader)
 {
     harvestJob.JobStartDate       = dataReader.GetDateTime(HarvestJobTableData.JOBSTARTDATE, DateTime.MinValue);
     harvestJob.HarvestStartDate   = dataReader.GetDateTime(HarvestJobTableData.HARVESTSTARTDATE, DateTime.MinValue);
     harvestJob.HarvestCurrentDate = dataReader.GetDateTime(HarvestJobTableData.HARVESTCURRENTDATE, DateTime.MinValue);
     harvestJob.HarvestEndDate     = dataReader.GetDateTime(HarvestJobTableData.HARVESTENDDATE, DateTime.MinValue);
     harvestJob.JobEndDate         = dataReader.GetDateTime(HarvestJobTableData.JOBENDDATE, DateTime.MinValue);
     harvestJob.JobStatus          = (HarvestStatusEnum)Enum.Parse(typeof(HarvestStatusEnum), dataReader.GetString(HarvestJobTableData.JOBSTATUS), true);
 }
        /// <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);
        }
Ejemplo n.º 4
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);
 }