精简代码

parent 402df3e5
......@@ -105,9 +105,8 @@ public EpSheet ReadSheet(per_allot allot, string sheetName)
using (ExcelPackage package = new ExcelPackage(file))
{
foreach (var sheet in package.Workbook.Worksheets)
{
if (sheet.Name != sheetName) continue;
var sheet = package.Workbook.Worksheets.FirstOrDefault(w => w.Name == sheetName);
if (sheet == null) return null;
IEnumerable<EpMerge> mergeCells = GetMergeCells(sheet);
List<double> colWidths = GetColWidths(sheet);
......@@ -160,10 +159,9 @@ public EpSheet ReadSheet(per_allot allot, string sheetName)
_cache.Set(key, epSheet, absoluteExpirationRelativeToNow);
return epSheet;
}
}
return null;
}
#region
//private static List<double> GetRowHeights(ExcelWorksheet sheet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment