fix error

This commit is contained in:
dingxiaowei
2022-08-26 19:25:24 +08:00
parent 52f0c31497
commit 4059d7777c
12 changed files with 18 additions and 2 deletions
+3 -1
View File
@@ -11,12 +11,14 @@ namespace ExcelTool
private List<TableExcelHeader> headers = new List<TableExcelHeader>();
private List<TableExcelRow> rows = new List<TableExcelRow>();
public int CollonCount = 0;
public int RowCounts = 0;
public TableExcelData(IEnumerable<TableExcelHeader> headers, IEnumerable<TableExcelRow> rows)
{
this.headers = headers.ToList();
this.rows = rows.ToList();
this.CollonCount = this.headers.Count;
this.RowCounts = this.rows.Count;
}
public List<TableExcelHeader> Headers
@@ -32,7 +34,7 @@ namespace ExcelTool
//TODO:待检查数据类型的合法性
//public bool CheckUnique(out string errorMsg)
//{
//}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace ExcelTool
//先写入行数,然后每一行的数据一次写入 小写类型、字符串
List<Tuple<string, string>> datas = new List<Tuple<string, string>>();
var tableData = ExcelHelper.ExcelDatas(fileName);
Tuple<string, string> rowCount = new Tuple<string, string>("int", tableData.CollonCount.ToString());
Tuple<string, string> rowCount = new Tuple<string, string>("int", tableData.RowCounts.ToString());
datas.Add(rowCount);
foreach (var row in tableData.Rows)
{