- 显示声明类型
- 使用自动化访问器 - 修复拼写错误
This commit is contained in:
@@ -5,28 +5,20 @@ namespace ExcelTool.Parser
|
||||
{
|
||||
public class TableExcelData
|
||||
{
|
||||
List<TableExcelHeader> headers = new();
|
||||
List<TableExcelRow> rows = new();
|
||||
public int CollonCount = 0;
|
||||
public int RowCounts = 0;
|
||||
public readonly int ColumnCount = 0;
|
||||
public readonly int RowCounts = 0;
|
||||
|
||||
public List<TableExcelHeader> Headers { get; }
|
||||
public List<TableExcelRow> Rows { get; }
|
||||
|
||||
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;
|
||||
Headers = headers.ToList();
|
||||
Rows = rows.ToList();
|
||||
this.ColumnCount = Headers.Count;
|
||||
this.RowCounts = Rows.Count;
|
||||
}
|
||||
|
||||
public List<TableExcelHeader> Headers
|
||||
{
|
||||
get { return this.headers; }
|
||||
}
|
||||
|
||||
public List<TableExcelRow> Rows
|
||||
{
|
||||
get { return this.rows; }
|
||||
}
|
||||
|
||||
//TODO:待检查数据类型的合法性
|
||||
//public bool CheckUnique(out string errorMsg)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace ExcelTool.Parser
|
||||
datas.Add(rowCount);
|
||||
foreach (var row in sheet.Data.Rows)
|
||||
{
|
||||
for (int i = 0; i < sheet.Data.CollonCount; i++)
|
||||
for (int i = 0; i < sheet.Data.ColumnCount; i++)
|
||||
{
|
||||
var type = sheet.Data.Headers[i].FieldType.ToLower();
|
||||
var data = row.StrList[i];
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ExcelTool
|
||||
string outputDataDir = "";
|
||||
string nameSpace = "";
|
||||
|
||||
foreach (var arg in args)
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if (arg.StartsWith("--input="))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user