From 3feab7cf5f8755b4c05a6d57aece037947b16273 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sat, 12 Feb 2022 16:53:34 +0300 Subject: Extract PriceListHeaders class --- src/PriceListTools/SourcePriceList.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/PriceListTools/SourcePriceList.cs') diff --git a/src/PriceListTools/SourcePriceList.cs b/src/PriceListTools/SourcePriceList.cs index 01637f8..d03d776 100644 --- a/src/PriceListTools/SourcePriceList.cs +++ b/src/PriceListTools/SourcePriceList.cs @@ -7,7 +7,6 @@ using RehauSku.Interface; namespace RehauSku.PriceListTools { - internal class SourcePriceList : AbstractPriceList { public Dictionary PositionAmount { get; private set; } @@ -24,10 +23,10 @@ namespace RehauSku.PriceListTools Range[] cells = new[] { - amountCell = Sheet.Cells.Find(amountHeader), - skuCell = Sheet.Cells.Find(skuHeader), - groupCell = Sheet.Cells.Find(groupHeader), - nameCell = Sheet.Cells.Find(nameHeader) + AmountCell = Sheet.Cells.Find(PriceListHeaders.Amount), + SkuCell = Sheet.Cells.Find(PriceListHeaders.Sku), + GroupCell = Sheet.Cells.Find(PriceListHeaders.Group), + NameCell = Sheet.Cells.Find(PriceListHeaders.Name) }; if (cells.Any(x => x == null)) @@ -76,15 +75,15 @@ namespace RehauSku.PriceListTools { PositionAmount = new Dictionary(); - for (int row = amountCell.Row + 1; row <= Sheet.Cells[Sheet.Rows.Count, amountCell.Column].End[XlDirection.xlUp].Row; row++) + for (int row = AmountCell.Row + 1; row <= Sheet.Cells[Sheet.Rows.Count, AmountCell.Column].End[XlDirection.xlUp].Row; row++) { - object amount = Sheet.Cells[row, amountCell.Column].Value2; + object amount = Sheet.Cells[row, AmountCell.Column].Value2; if (amount != null && (double)amount != 0) { - object group = Sheet.Cells[row, groupCell.Column].Value2; - object name = Sheet.Cells[row, nameCell.Column].Value2; - object sku = Sheet.Cells[row, skuCell.Column].Value2; + object group = Sheet.Cells[row, GroupCell.Column].Value2; + object name = Sheet.Cells[row, NameCell.Column].Value2; + object sku = Sheet.Cells[row, SkuCell.Column].Value2; if (group == null || name == null || sku == null) continue; -- cgit v1.2.3