示例#1
0
        public List <ImportProcessTrendEntity> Adapt(DataTable dt)
        {
            List <ImportProcessTrendEntity> results = new List <ImportProcessTrendEntity>();

            foreach (DataRow rw in dt.Rows)
            {
                ImportProcessTrendEntity matchCode = new ImportProcessTrendEntity();
                matchCode = AdaptItem(rw);
                results.Add(matchCode);
            }
            return(results);
        }
示例#2
0
        public ImportProcessTrendEntity AdaptItem(DataRow rw)
        {
            ImportProcessTrendEntity result = new ImportProcessTrendEntity();

            if (rw.Table.Columns["ImportedDate"] != null)
            {
                result.ImportedDate = SafeHelper.GetSafeDateTime(rw["ImportedDate"]);
            }

            if (rw.Table.Columns["ImportedRecordCount"] != null)
            {
                result.ImportedRecordCount = SafeHelper.GetSafeint(rw["ImportedRecordCount"]);
            }

            if (rw.Table.Columns["EpochDate"] != null)
            {
                result.EpochDate = SafeHelper.GetSafedouble(rw["EpochDate"]) * 1000;
            }

            return(result);
        }