2using NPOI.SS.UserModel;
6 public static IRow
row;
10 public static bool IsNull(ICell cell)
12 if (cell !=
null && cell.CellType != CellType.Blank)
14 return cell.CellType == CellType.Unknown;
21 if (
int.TryParse(
GetStr(
id), out var result))
28 public static int GetInt(
int col, IRow _row)
46 public static bool GetBool(
int col, IRow _row)
57 return double.Parse(str);
67 return float.Parse(str);
77 return Array.ConvertAll(str.Split(
','),
float.Parse);
87 return Array.ConvertAll(str.Split(
','),
int.Parse);
97 return str.Split(
',');
113 public static string GetStr(
int id,
bool useDefault =
false)
120 return GetStr(
id, useDefault:
true);
124 ICell cell =
row.GetCell(
id);
129 return GetStr(
id, useDefault:
true);
133 cell.SetCellType(CellType.String);
134 if (cell.StringCellValue ==
"")
138 return GetStr(
id, useDefault:
true);
142 return cell.StringCellValue;
static bool GetBool(int id)
static bool GetBool(int col, IRow _row)
static int GetInt(int id)
static bool IsNull(ICell cell)
static string GetString(int id)
static int[] GetIntArray(int id)
static int GetInt(int col, IRow _row)
static float GetFloat(int id)
static double GetDouble(int id)
static string GetStr(int id, bool useDefault=false)
static float[] GetFloatArray(int id)
static string GetString(int col, IRow _row)
static string[] GetStringArray(int id)