风光大葬

This commit is contained in:
2025-11-04 11:37:27 +08:00
parent 628cfabf97
commit bdf67a0312
329 changed files with 3048 additions and 1222 deletions

View File

@@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ramitta
namespace Ramitta.Excellib
{
public static class Excel
{
@@ -165,5 +165,27 @@ namespace Ramitta
}
return true;
}
public static ICell? getRowCell(ISheet sheet, int rowIndex, int cellIndex)
{
IRow row = sheet.GetRow(rowIndex);
if (row == null) return null;
ICell cell = row.GetCell(cellIndex);
if (cell == null) return null;
return cell;
}
public static String? getRowCellStr(ISheet sheet, int rowIndex, int cellIndex)
{
var cellValue = getRowCell(sheet, rowIndex, cellIndex)?.ToString();
return string.IsNullOrWhiteSpace(cellValue) ? null : cellValue;
}
// 简短版本
public static int ColToIndex(string col)
{
return col.ToUpper().Aggregate(0, (cur, ch) => cur * 26 + (ch - 'A'));
}
}
}