From aec2aa1e20c4e6614defed97f8af53fe5d6f425a Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 19 Apr 2023 23:37:16 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormReportManufactureWorkPieces.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureWorkPieces.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureWorkPieces.cs index 1762eca..d2d809a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureWorkPieces.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureWorkPieces.cs @@ -22,6 +22,7 @@ namespace BlacksmithWorkshop public FormReportManufactureWorkPieces(ILogger logger, IReportLogic logic) { InitializeComponent(); + _logger = logger; _logic = logic; } @@ -55,13 +56,18 @@ namespace BlacksmithWorkshop catch (Exception ex) { _logger.LogError(ex, "Ошибка загрузки списка изделий по заготовкам"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void ButtonSaveToExcel_Click(object sender, EventArgs e) { - using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; + //фильтрация файлов для диалогового окна + using var dialog = new SaveFileDialog + { + Filter = "xlsx|*.xlsx" + }; if (dialog.ShowDialog() == DialogResult.OK) { @@ -73,11 +79,13 @@ namespace BlacksmithWorkshop }); _logger.LogInformation("Сохранение списка изделий по заготовкам"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { _logger.LogError(ex, "Ошибка сохранения списка изделий по заготовкам"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }