aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools/Target.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PriceListTools/Target.cs')
-rw-r--r--src/PriceListTools/Target.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/PriceListTools/Target.cs b/src/PriceListTools/Target.cs
new file mode 100644
index 0000000..a7e87ec
--- /dev/null
+++ b/src/PriceListTools/Target.cs
@@ -0,0 +1,25 @@
+using Microsoft.Office.Interop.Excel;
+using System;
+
+namespace RehauSku.PriceListTools
+{
+ internal class Target : PriceList
+ {
+ public Target(Workbook workbook)
+ {
+ Sheet = workbook.ActiveSheet;
+ Name = workbook.FullName;
+
+ amountCell = Sheet.Cells.Find(amountHeader);
+ skuCell = Sheet.Cells.Find(skuHeader);
+ groupCell = Sheet.Cells.Find(groupHeader);
+ nameCell = Sheet.Cells.Find(nameHeader);
+
+ if (amountCell == null || skuCell == null || groupCell == null || nameCell == null)
+ {
+ throw new ArgumentException($"Шаблон { Name } не является прайс-листом");
+ }
+ }
+ }
+}
+