public void MappByName() { HlpTable hlp = null; foreach (var item in table.ColumnsList) { item.Mapping = item.Mapping == null || item.Mapping == "" ? item.Name : item.Mapping; hlp = descTable.ColumnsList.Where(z => z.Name.ToUpper() == item.Mapping.ToUpper()).FirstOrDefault(); if (hlp != null) { item.MapDestColumn = hlp.Name; } } }
public void MappByOrader() { HlpTable hlp = null; int i = 0; foreach (var item in table.ColumnsList) { if (i < descTable.ColumnsList.Count) { item.Mapping = item.Mapping == null || item.Mapping == "" ? item.Name : item.Mapping; hlp = descTable.ColumnsList[i]; if (hlp != null) { item.MapDestColumn = hlp.Name; } i++; } } }