public static StockCMEntity[] DataTableToCMEntitys(DataTable dt) { if (dt == null) return null; var results = new StockCMEntity[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { results[i] = DataRowToCMEntity(dt.Rows[i]); } return results; }
public static StockCMEntity DataRowToCMEntity(DataRow dataRow) { if (dataRow == null) return null; var result = new StockCMEntity(); var entity = DataRowToEntity(dataRow); FengSharp.Tool.Reflect.ClassValueCopier.Copy(result, entity); result.CreateName = dataRow["CreateName"].ToString(); result.LastModifyName = dataRow["LastModifyName"].ToString(); return result; }