public List <ImportExportJobQueueEntity> Adapt(DataTable dt) { List <ImportExportJobQueueEntity> results = new List <ImportExportJobQueueEntity>(); foreach (DataRow rw in dt.Rows) { ImportExportJobQueueEntity ExportJob = new ImportExportJobQueueEntity(); ExportJob = AdaptItem(rw, dt); results.Add(ExportJob); } return(results); }
public ImportExportJobQueueEntity AdaptItem(DataRow rw, DataTable dt) { ImportExportJobQueueEntity result = new ImportExportJobQueueEntity(); if (dt.Columns.Contains("Id")) { result.Id = SafeHelper.GetSafeint(rw["Id"]); } if (dt.Columns.Contains("Host")) { result.ApplicationSubDomain = SafeHelper.GetSafestring(rw["Host"]); } if (dt.Columns.Contains("FileName")) { result.FileName = SafeHelper.GetSafestring(rw["FileName"]); } if (dt.Columns.Contains("Format")) { result.Format = SafeHelper.GetSafestring(rw["Format"]); } if (dt.Columns.Contains("RequestedDate")) { result.RequestedDate = SafeHelper.GetSafeDateTime(rw["RequestedDate"]); } if (dt.Columns.Contains("ProcessStartDate")) { //if (rw["ProcessStartDate"] == DBNull.Value) //{ // result.ProcessStartDate = DateTime.MinValue; //} //else //{ result.ProcessStartDate = SafeHelper.GetSafeDateTimeIfNull(rw["ProcessStartDate"]); //} } if (dt.Columns.Contains("ProcessEndDate")) { //if (rw["ProcessEndDate"] == DBNull.Value) //{ // result.ProcessEndDate = DateTime.MinValue; //} //else //{ result.ProcessEndDate = SafeHelper.GetSafeDateTimeIfNull(rw["ProcessEndDate"]); //} } if (dt.Columns.Contains("IsProcessComplete")) { result.IsProcessComplete = SafeHelper.GetSafebool(rw["IsProcessComplete"]); } if (dt.Columns.Contains("isDeleted")) { result.isDeleted = SafeHelper.GetSafebool(rw["isDeleted"]); } if (dt.Columns.Contains("ExportType")) { result.ExportType = SafeHelper.GetSafestring(rw["ExportType"]); } return(result); }