diff options
Diffstat (limited to 'src/PriceListTools/TargetPriceList.cs')
-rw-r--r-- | src/PriceListTools/TargetPriceList.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/PriceListTools/TargetPriceList.cs b/src/PriceListTools/TargetPriceList.cs new file mode 100644 index 0000000..32b071c --- /dev/null +++ b/src/PriceListTools/TargetPriceList.cs @@ -0,0 +1,34 @@ +using Microsoft.Office.Interop.Excel; +using System; +using System.Linq; + +namespace RehauSku.PriceListTools +{ + internal class TargetPriceList : AbstractPriceList + { + private const string oldSkuHeader = "Прежний материал"; + public Range oldSkuCell { get; private set; } + + public TargetPriceList(Workbook workbook) + { + Sheet = workbook.ActiveSheet; + Name = workbook.FullName; + + Range[] cells = new[] + { + amountCell = Sheet.Cells.Find(amountHeader), + skuCell = Sheet.Cells.Find(skuHeader), + groupCell = Sheet.Cells.Find(groupHeader), + nameCell = Sheet.Cells.Find(nameHeader) + }; + + oldSkuCell = Sheet.Cells.Find(oldSkuHeader); + + if (cells.Any(x => x == null)) + { + throw new ArgumentException($"Шаблон { Name } не является прайс-листом"); + } + } + } +} + |