Пример #1
0
        private ExternalRow CreateRow(TextRow tRow, ref int index)
        {
            ExternalRow row = new ExternalRow();

            row.Number = index++;

            ColumHeader.ForEach(c => row.Cells.Add(new ExternalCell()
            {
                Column = c, Row = row, Value = tRow[c.Number - 1]
            }));

            return(row);
        }
Пример #2
0
        private ExternalRow CreateRow(List <String> tRow, ref int index)
        {
            ExternalRow row = new ExternalRow();

            row.Number = index++;
            if (tRow.Count == ColumHeader.Count)
            {
                ColumHeader.Select((c, colIndex) => new { Col = c, Index = colIndex }).ToList().ForEach(c => row.Cells.Add(new ExternalCell()
                {
                    Column = c.Col, Row = row, Value = tRow[c.Index]
                }));
            }
            else
            {
                ColumHeader.ForEach(c => row.Cells.Add(new ExternalCell()
                {
                    Column = c, Row = row, Value = tRow[c.Number - 1]
                }));
            }

            return(row);
        }