RhSolutions-AddIn/src/PriceListTools/Target.cs

26 lines
745 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);
2022-01-28 18:15:13 +03:00
nameCell = Sheet.Cells.Find(nameHeader);
2022-01-27 09:59:33 +03:00
2022-01-28 18:15:13 +03:00
if (amountCell == null || skuCell == null || groupCell == null || nameCell == null)
2022-01-27 09:59:33 +03:00
{
2022-01-27 17:34:03 +03:00
throw new ArgumentException($"Шаблон { Name } не является прайс-листом");
2022-01-27 09:59:33 +03:00
}
}
}
}