public List <PrimaryStatsEntity> Adapt(DataTable dt) { List <PrimaryStatsEntity> results = new List <PrimaryStatsEntity>(); foreach (DataRow rw in dt.Rows) { PrimaryStatsEntity matchCode = new PrimaryStatsEntity(); matchCode = AdaptItem(rw); results.Add(matchCode); } return(results); }
public PrimaryStatsEntity AdaptItem(DataRow rw) { PrimaryStatsEntity result = new PrimaryStatsEntity(); if (rw.Table.Columns["FilesAwaitingImportCount"] != null) { result.FilesAwaitingImportCount = SafeHelper.GetSafeint(rw["FilesAwaitingImportCount"]); } if (rw.Table.Columns["InputRecordCount_Total"] != null) { result.InputRecordCount_Total = SafeHelper.GetSafeint(rw["InputRecordCount_Total"]); } if (rw.Table.Columns["InputRecordCount_AwaitingProcessing"] != null) { result.InputRecordCount_AwaitingProcessing = SafeHelper.GetSafeint(rw["InputRecordCount_AwaitingProcessing"]); } if (rw.Table.Columns["InputRecordCount_Processing"] != null) { result.InputRecordCount_Processing = SafeHelper.GetSafeint(rw["InputRecordCount_Processing"]); } if (rw.Table.Columns["InputRecordCount_Failed"] != null) { result.InputRecordCount_Failed = SafeHelper.GetSafeint(rw["InputRecordCount_Failed"]); } if (rw.Table.Columns["InputRecordFileCount"] != null) { result.InputRecordFileCount = SafeHelper.GetSafeint(rw["InputRecordFileCount"]); } if (rw.Table.Columns["LowConfidenceMatchRecordCount"] != null) { result.LowConfidenceMatchRecordCount = SafeHelper.GetSafeint(rw["LowConfidenceMatchRecordCount"]); } if (rw.Table.Columns["NoMatchRecordCount"] != null) { result.NoMatchRecordCount = SafeHelper.GetSafeint(rw["NoMatchRecordCount"]); } if (rw.Table.Columns["MatchProcessingRecordCount"] != null) { result.MatchProcessingRecordCount = SafeHelper.GetSafeint(rw["MatchProcessingRecordCount"]); } if (rw.Table.Columns["EnrichmentProcessingCount"] != null) { result.EnrichmentProcessingCount = SafeHelper.GetSafeint(rw["EnrichmentProcessingCount"]); } if (rw.Table.Columns["EnrichmentProcessingDUNSCount"] != null) { result.EnrichmentProcessingDUNSCount = SafeHelper.GetSafeint(rw["EnrichmentProcessingDUNSCount"]); } if (rw.Table.Columns["MatchExportRecordCount"] != null) { result.MatchExportRecordCount = SafeHelper.GetSafeint(rw["MatchExportRecordCount"]); } if (rw.Table.Columns["EnrichmentExportDUNSCount"] != null) { result.EnrichmentExportDUNSCount = SafeHelper.GetSafeint(rw["EnrichmentExportDUNSCount"]); } if (rw.Table.Columns["MonitoringExportDUNSCount"] != null) { result.MonitoringExportDUNSCount = SafeHelper.GetSafeint(rw["MonitoringExportDUNSCount"]); } if (rw.Table.Columns["LatestMonitoringChangeDateTime"] != null) { result.LatestMonitoringChangeDateTime = SafeHelper.GetSafeDateTime(rw["LatestMonitoringChangeDateTime"]); } if (rw.Table.Columns["QueueStatus"] != null) { result.QueueStatus = SafeHelper.GetSafestring(rw["QueueStatus"]); } return(result); }