From 379fb6d99673e390e701b0b16e10dbc2d4edb148 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sun, 9 Jan 2022 10:49:41 +0300 Subject: [PATCH] Add virtual GetSource with no params to abstract pricelist tool --- src/PriceListTools/AbstractPriceListTool.cs | 5 +++++ src/PriceListTools/ExportTool.cs | 3 ++- src/Ribbon/RibbonController.cs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PriceListTools/AbstractPriceListTool.cs b/src/PriceListTools/AbstractPriceListTool.cs index 04d11af..1aef0be 100644 --- a/src/PriceListTools/AbstractPriceListTool.cs +++ b/src/PriceListTools/AbstractPriceListTool.cs @@ -39,6 +39,11 @@ namespace RehauSku.PriceListTools } } + public virtual void GetSource() + { + throw new NotImplementedException(); + } + public virtual void GetSource(string[] files) { ExcelApp.ScreenUpdating = false; diff --git a/src/PriceListTools/ExportTool.cs b/src/PriceListTools/ExportTool.cs index fbafbdd..9a2c5fd 100644 --- a/src/PriceListTools/ExportTool.cs +++ b/src/PriceListTools/ExportTool.cs @@ -17,10 +17,11 @@ namespace RehauSku.PriceListTools Selection = ExcelApp.Selection; } - public override void GetSource(string[] files) + public override void GetSource() { if (Selection != null && Selection.Columns.Count == 2) FillSkuAmountDict(); + else throw new Exception("Неверный диапазон"); } diff --git a/src/Ribbon/RibbonController.cs b/src/Ribbon/RibbonController.cs index d0eb590..15bd1a0 100644 --- a/src/Ribbon/RibbonController.cs +++ b/src/Ribbon/RibbonController.cs @@ -65,7 +65,7 @@ namespace RehauSku.Ribbon { using (ExportTool exportTool = new ExportTool()) { - exportTool.GetSource(null); + exportTool.GetSource(); string exportFile = PriceList.CreateNewFile(); exportTool.OpenNewPrice(exportFile); exportTool.FillPriceList();