2023-04-06 16:38:26 +07:00
|
|
|
|
using OfficeOpenXml;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
2026-05-12 16:32:46 +07:00
|
|
|
|
namespace BMA.EHR.Recruit.Extensions
|
2023-04-06 16:38:26 +07:00
|
|
|
|
{
|
|
|
|
|
|
public static class ExcelWorksheetExtension
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string[] GetHeaderColumns(this ExcelWorksheet sheet, int row = 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<string> columnNames = new List<string>();
|
|
|
|
|
|
foreach (var firstRowCell in sheet.Cells[row, sheet.Dimension.Start.Column, 1, sheet.Dimension.End.Column])
|
|
|
|
|
|
columnNames.Add(firstRowCell.Text);
|
|
|
|
|
|
return columnNames.ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|