From f4ea6bd0714665ad13025155bec7bdb5b37d8f06 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Tue, 7 Dec 2021 08:28:21 +0300 Subject: [PATCH] Add OnButtonPressed method to Riboon controller --- Source/DataExport/RibbonController.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Source/DataExport/RibbonController.cs b/Source/DataExport/RibbonController.cs index a9eedb5..3ae9099 100644 --- a/Source/DataExport/RibbonController.cs +++ b/Source/DataExport/RibbonController.cs @@ -1,6 +1,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using ExcelDna.Integration.CustomUI; +using Rehau.Sku.Assist; namespace Ribbon { @@ -22,5 +23,23 @@ namespace Ribbon "; } + + public void OnButtonPressed(IRibbonControl control) + { + using (DataWriter dw = new DataWriter()) + { + if (!dw.IsRangeValid()) + { + MessageBox.Show("Выделен неверный диапазон!", "Неверный диапазон", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + + else + { + dw.FillSkuAmountDict(); + dw.FillPriceList(); + } + } + } } }