public List <DashboardBackgroundProcessEntity> Adapt(DataTable dt) { List <DashboardBackgroundProcessEntity> results = new List <DashboardBackgroundProcessEntity>(); foreach (DataRow rw in dt.Rows) { DashboardBackgroundProcessEntity matchCode = new DashboardBackgroundProcessEntity(); matchCode = AdaptItem(rw); results.Add(matchCode); } return(results); }
public DashboardBackgroundProcessEntity AdaptItem(DataRow rw) { DashboardBackgroundProcessEntity result = new DashboardBackgroundProcessEntity(); if (rw.Table.Columns["ExecutionId"] != null) { result.ExecutionId = SafeHelper.GetSafeint(rw["ExecutionId"]); } if (rw.Table.Columns["ProcessStartDateTime"] != null) { result.AuditDateTime = SafeHelper.GetSafeDateTime(rw["ProcessStartDateTime"]); } if (rw.Table.Columns["RunDuration_ms"] != null) { result.Duration_ms = SafeHelper.GetSafeint(rw["RunDuration_ms"]); } if (rw.Table.Columns["Status"] != null) { result.ProcessStatus = SafeHelper.GetSafestring(rw["Status"]); } if (rw.Table.Columns["Message"] != null) { result.Message = SafeHelper.GetSafestring(rw["Message"]); } if (rw.Table.Columns["ETLType"] != null) { result.ETLType = SafeHelper.GetSafestring(rw["ETLType"]); } if (rw.Table.Columns["NextRunTime_Seconds"] != null) { result.NextRunTime_Seconds = SafeHelper.GetSafeint(rw["NextRunTime_Seconds"]); } if (rw.Table.Columns["RunDuration"] != null) { result.Duration = SafeHelper.GetSafestring(rw["RunDuration"]); } return(result); }