aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools/Target.cs
blob: 7abe9e2b3ef4b367102d42f6a3728f793d3a6705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);

            if (amountCell == null || skuCell == null || groupCell == null)
            {
                throw new ArgumentException($"Шаблон { Name } не является прайс-листом");
            }
        }
    }
}