From dbd09b538651304dc459cc7834ab1383931f3b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=82=D1=8C=D1=8F=D0=BD=D0=B0=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2=D0=B0?= Date: Thu, 9 Nov 2023 18:19:41 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B3=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainPluginConvention.cs | 20 ++++++++++++++++++- .../Plugins/IPluginsConvention.cs | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/PluginsConventionLibrary/MainPluginConvention.cs b/PluginsConventionLibrary/MainPluginConvention.cs index c997f4f..b4cf92f 100644 --- a/PluginsConventionLibrary/MainPluginConvention.cs +++ b/PluginsConventionLibrary/MainPluginConvention.cs @@ -38,6 +38,24 @@ namespace PluginsConventionLibrary }; tableOfValues.ContextMenuStrip = menu; ReloadData(); + Configure(); + } + + public void ReloadData() + { + try + { + tableOfValues.ClearRows(); + var list = _studentLogic.Read(null); + if (list != null) + { + tableOfValues.SetCellValueFromList(list); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } /// Название плагина @@ -93,7 +111,7 @@ namespace PluginsConventionLibrary return true; } - public void ReloadData() + public void Configure() { var columnConfigs = new List { diff --git a/PluginsConventionLibrary/Plugins/IPluginsConvention.cs b/PluginsConventionLibrary/Plugins/IPluginsConvention.cs index f85aa18..af3c095 100644 --- a/PluginsConventionLibrary/Plugins/IPluginsConvention.cs +++ b/PluginsConventionLibrary/Plugins/IPluginsConvention.cs @@ -35,6 +35,7 @@ /// Обновление набора данных в контроле /// void ReloadData(); + void Configure(); /// /// Создание простого документа