RhSolutions-AddIn/src/PriceListTools/Target.cs

25 lines
672 B
C#
Raw Normal View History

2022-01-27 09:59:33 +03:00
using Microsoft.Office.Interop.Excel;
using System;
namespace RehauSku.PriceListTools
{
2022-01-27 10:22:30 +03:00
internal class Target : PriceList
2022-01-27 09:59:33 +03:00
{
2022-01-27 10:22:30 +03:00
public Target(Workbook workbook)
2022-01-27 09:59:33 +03:00
{
Sheet = workbook.ActiveSheet;
2022-01-27 17:34:03 +03:00
Name = workbook.FullName;
2022-01-27 09:59:33 +03:00
amountCell = Sheet.Cells.Find(amountHeader);
skuCell = Sheet.Cells.Find(skuHeader);
groupCell = Sheet.Cells.Find(groupHeader);
if (amountCell == null || skuCell == null || groupCell == null)
{
2022-01-27 17:34:03 +03:00
throw new ArgumentException($"Шаблон { Name } не является прайс-листом");
2022-01-27 09:59:33 +03:00
}
}
}
}