From 846547d6d905e0dbee73cd9c62760ea43bb88134 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sun, 9 Jan 2022 15:47:54 +0300 Subject: Add SaveAs Dialog after export --- src/Ribbon/RibbonController.cs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/Ribbon/RibbonController.cs') diff --git a/src/Ribbon/RibbonController.cs b/src/Ribbon/RibbonController.cs index 15bd1a0..ed59541 100644 --- a/src/Ribbon/RibbonController.cs +++ b/src/Ribbon/RibbonController.cs @@ -40,10 +40,13 @@ namespace RehauSku.Ribbon using (MergeTool mergeTool = new MergeTool()) { string[] files = Dialog.GetMultiplyFiles(); - mergeTool.GetSource(files); - string exportFile = PriceList.CreateNewFile(); - mergeTool.OpenNewPrice(exportFile); - mergeTool.FillPriceList(); + if (files.Length != 0) + { + mergeTool.GetSource(files); + string exportFile = RegistryUtil.PriceListPath; + mergeTool.OpenNewPrice(exportFile); + mergeTool.FillPriceList(); + } } } @@ -52,10 +55,13 @@ namespace RehauSku.Ribbon using (CombineTool combineTool = new CombineTool()) { string[] files = Dialog.GetMultiplyFiles(); - combineTool.GetSource(files); - string exportFile = PriceList.CreateNewFile(); - combineTool.OpenNewPrice(exportFile); - combineTool.FillPriceList(); + if (files.Length != 0) + { + combineTool.GetSource(files); + string exportFile = RegistryUtil.PriceListPath; + combineTool.OpenNewPrice(exportFile); + combineTool.FillPriceList(); + } } } @@ -66,7 +72,7 @@ namespace RehauSku.Ribbon using (ExportTool exportTool = new ExportTool()) { exportTool.GetSource(); - string exportFile = PriceList.CreateNewFile(); + string exportFile = RegistryUtil.PriceListPath; exportTool.OpenNewPrice(exportFile); exportTool.FillPriceList(); } -- cgit v1.2.3