aboutsummaryrefslogtreecommitdiff
path: root/src/AddIn
diff options
context:
space:
mode:
Diffstat (limited to 'src/AddIn')
-rw-r--r--src/AddIn/EventsUtil.cs2
-rw-r--r--src/AddIn/WorksheetExtensions.cs14
2 files changed, 6 insertions, 10 deletions
diff --git a/src/AddIn/EventsUtil.cs b/src/AddIn/EventsUtil.cs
index 102e12e..bc8d1d3 100644
--- a/src/AddIn/EventsUtil.cs
+++ b/src/AddIn/EventsUtil.cs
@@ -4,7 +4,7 @@ namespace RehauSku
{
internal static class EventsUtil
{
- private static Application Excel = AddIn.Excel;
+ private static readonly Application Excel = AddIn.Excel;
public static void Initialize()
{
diff --git a/src/AddIn/WorksheetExtensions.cs b/src/AddIn/WorksheetExtensions.cs
index cffa55c..7880b66 100644
--- a/src/AddIn/WorksheetExtensions.cs
+++ b/src/AddIn/WorksheetExtensions.cs
@@ -1,15 +1,11 @@
using Microsoft.Office.Interop.Excel;
+using RehauSku.PriceListTools;
using System.Linq;
namespace RehauSku
{
public static class WorksheetExtensions
{
- private static string amountHeader = "Кол-во";
- private static string skuHeader = "Актуальный материал";
- private static string groupHeader = "Программа";
- private static string nameHeader = "Наименование";
-
public static bool IsRehauSource(this Worksheet worksheet)
{
Range amountCell;
@@ -19,10 +15,10 @@ namespace RehauSku
Range[] cells = new[]
{
- amountCell = worksheet.Cells.Find(amountHeader),
- skuCell = worksheet.Cells.Find(skuHeader),
- groupCell = worksheet.Cells.Find(groupHeader),
- nameCell = worksheet.Cells.Find(nameHeader)
+ amountCell = worksheet.Cells.Find(PriceListHeaders.Amount),
+ skuCell = worksheet.Cells.Find(PriceListHeaders.Sku),
+ groupCell = worksheet.Cells.Find(PriceListHeaders.Group),
+ nameCell = worksheet.Cells.Find(PriceListHeaders.Name)
};
return cells.All(x => x != null);