public static DlyTypeEntity[] DataTableToEntitys(DataTable dt) { if (dt == null) return null; var results = new DlyTypeEntity[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { results[i] = DataRowToEntity(dt.Rows[i]); } return results; }
public static DlyTypeEntity DataRowToEntity(DataRow row) { if (row == null) return null; var result = new DlyTypeEntity() { DlyFormat = (string)(row["DlyFormat"]), DlyHeader = (string)(row["DlyHeader"]), DlyName = (string)(row["DlyName"]), DlyTypeId = (int)(row["DlyTypeId"]), InputLevel = (short)(row["InputLevel"]), Remark = (string)(row["Remark"]), PId = (int)(row["PId"]), Level_Path = (string)(row["Level_Path"]), Level_Num = (int)(row["Level_Num"]), Level_Total = (int)(row["Level_Total"]), Level_Deep = (int)(row["Level_Deep"]), }; return result; }