diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-24 16:22:03 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-24 16:22:03 +0300 |
commit | 24024b5729c1c44bb01cb29813868743d1753e31 (patch) | |
tree | 673a1c1102e04adee36be8ded4934d2e40794fef /Source/Ribbon | |
parent | 2a4076d6eef1b4556f6af8cb074638d440927c5e (diff) |
MergeTool, MemoryUtil anf stuff
Diffstat (limited to 'Source/Ribbon')
-rw-r--r-- | Source/Ribbon/RibbonController.cs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/Source/Ribbon/RibbonController.cs b/Source/Ribbon/RibbonController.cs index 325b4c6..0090761 100644 --- a/Source/Ribbon/RibbonController.cs +++ b/Source/Ribbon/RibbonController.cs @@ -1,7 +1,8 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using ExcelDna.Integration.CustomUI; -using RehauSku.DataExport; +using RehauSku.PriceListTools; +using RehauSku.Forms; namespace RehauSku.Ribbon { @@ -17,6 +18,7 @@ namespace RehauSku.Ribbon <tab id='rau' label='REHAU'> <group id='priceList' label='Прайс-лист'> <button id='exportToPrice' label='Экспорт' size='large' imageMso='PivotExportToExcel' onAction='OnExportPressed'/> + <button id='mergeFiles' label='Объединить' size='large' imageMso='Copy' onAction='OnMergePressed'/> </group> <group id='rausettings' label='Настройки'> <button id='set' label='Настройки' size='large' imageMso='CurrentViewSettings' onAction='OnSettingsPressed'/> @@ -27,11 +29,22 @@ namespace RehauSku.Ribbon </customUI>"; } + public void OnMergePressed(IRibbonControl control) + { + using (MergeTool mergeTool = new MergeTool()) + { + string[] files = Dialog.GetMultiplyFiles(); + mergeTool.AddSkuAmountToDict(files); + string exportFile = PriceListUtil.CreateNewExportFile(); + mergeTool.ExportToNewFile(exportFile); + } + } + public void OnExportPressed(IRibbonControl control) { - using (ExportTool dw = new ExportTool()) + using (ExportTool exportTool = new ExportTool()) { - if (!dw.IsRangeValid()) + if (!exportTool.IsRangeValid()) { MessageBox.Show("Выделен неверный диапазон!", "Неверный диапазон", @@ -42,15 +55,17 @@ namespace RehauSku.Ribbon else { - dw.FillNewPriceList(); + exportTool.ExportToNewFile(); } } } - + public void OnSettingsPressed(IRibbonControl control) { - Form settingsForm = new Settings.SettingsForm(); + Form settingsForm = new SettingsForm(); + settingsForm.Show(); + } } } |