From 722de64dadd29744972ec5c5eca228f7a2e326e5 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 28 Jan 2022 09:08:35 +0300 Subject: [PATCH] Add convert Tool --- src/PriceListTools/PriceListTool.cs | 21 +++++++++++++++++++++ src/Ribbon/RibbonController.cs | 12 +++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/PriceListTools/PriceListTool.cs b/src/PriceListTools/PriceListTool.cs index cbae4d9..918b6de 100644 --- a/src/PriceListTools/PriceListTool.cs +++ b/src/PriceListTools/PriceListTool.cs @@ -6,6 +6,27 @@ using System.Linq; namespace RehauSku.PriceListTools { + internal class ConvertTool : PriceListTool + { + private Source Current; + + public void GetCurrent() + { + Current = new Source(ExcelApp.ActiveWorkbook); + } + + public void FillTarget() + { + ExcelApp.ScreenUpdating = false; + FillColumn(Current.SkuAmount, TargetFile.amountCell.Column); + FilterByAmount(); + ExcelApp.ScreenUpdating = true; + + Forms.Dialog.SaveWorkbookAs(); + } + } + + internal abstract class PriceListTool { protected private Application ExcelApp = (Application)ExcelDnaUtil.Application; diff --git a/src/Ribbon/RibbonController.cs b/src/Ribbon/RibbonController.cs index b00e23a..99f44df 100644 --- a/src/Ribbon/RibbonController.cs +++ b/src/Ribbon/RibbonController.cs @@ -20,13 +20,14 @@ namespace RehauSku.Ribbon