diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-03-22 08:36:13 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-03-22 08:36:13 +0300 |
commit | 4f448f203471a19a1444555a895f503515ad2fda (patch) | |
tree | 301b7df2561d650e4d300d24341342bd77ac7f3e /src/Models/TargetPriceList.cs | |
parent | 6484cac4f025bd84f7ffa2b2030d729dafe09d3d (diff) |
Add basic test
Diffstat (limited to 'src/Models/TargetPriceList.cs')
-rw-r--r-- | src/Models/TargetPriceList.cs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/Models/TargetPriceList.cs b/src/Models/TargetPriceList.cs deleted file mode 100644 index 2dcd48e..0000000 --- a/src/Models/TargetPriceList.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.Office.Interop.Excel; -using System; -using System.IO; -using System.Linq; -using Range = Microsoft.Office.Interop.Excel.Range; - -namespace RhSolutions.Models -{ - internal class TargetPriceList : PriceListBase - { - public Range OldSkuCell { get; private set; } - - public TargetPriceList(Workbook workbook) - { - if (workbook == null) - { - throw new ArgumentException("Невозможно открыть книгу шаблонного файла. " + - "Возможно открыт файл с именем, совпадающим с именем шаблонного файла."); - } - - Sheet = workbook.ActiveSheet; - Name = Path.GetFileNameWithoutExtension(workbook.FullName); - - Range[] cells = new[] - { - AmountCell = Sheet.Cells.Find(PriceListHeaders.Amount), - SkuCell = Sheet.Cells.Find(PriceListHeaders.Sku), - GroupCell = Sheet.Cells.Find(PriceListHeaders.Group), - NameCell = Sheet.Cells.Find(PriceListHeaders.Name) - }; - - OldSkuCell = Sheet.Cells.Find(PriceListHeaders.OldSku); - - if (cells.Any(x => x == null)) - { - throw new ArgumentException($"Шаблон {Name} не является прайс-листом"); - } - } - } -} - |