public static MiMFa_Table AddInTable(MiMFa_Table mainDT, object str, string colName, MiMFa_TableValuePositionType put) { switch (put) { case MiMFa_TableValuePositionType.NextRowCell: mainDT.AddRowSafe(); if (string.IsNullOrWhiteSpace(colName)) { mainDT.AddInLastRowCellSafe(str); } else { mainDT.AddInLastRowCellSafe(str, colName); } break; case MiMFa_TableValuePositionType.Null: case MiMFa_TableValuePositionType.NextColumnCell: if (string.IsNullOrWhiteSpace(colName)) { mainDT.AddInLastRowCellSafe(str); } else { mainDT.AddInLastRowCellSafe(str, colName); } break; case MiMFa_TableValuePositionType.NextSubCell: if (string.IsNullOrWhiteSpace(colName)) { mainDT.AppendInLastRowCellSafe(str); } else { mainDT.AppendInLastRowCellSafe(str, colName); } break; } return(mainDT); }
public static MiMFa_Table ConcatTable(MiMFa_Table mainDT, MiMFa_Table dt) { if (dt == null) { return(mainDT); } if (mainDT == null) { return(dt); } for (int i = 1; i < dt.MainTable.Rows.Count; i++) { mainDT.AddRowSafe(); for (int j = 0; j < dt.MainTable.Columns.Count; j++) { mainDT.AddInLastRowCellSafe(dt.MainTable.Rows[i][j], dt.MainTable.Rows[0][j] + ""); } } return(mainDT); }