diff --git a/Library/PluginsConvention.cs b/Library/PluginsConvention.cs index 2bf640a..79e4b7f 100644 --- a/Library/PluginsConvention.cs +++ b/Library/PluginsConvention.cs @@ -33,7 +33,41 @@ namespace Library public UserControl GetControl { - get { return _controlDataTable; } + get + { + Load(); + return _controlDataTable; + } + } + + private void Load() + { + _controlDataTable.TableConfiguration(5, new List + { + new TableParameters("Id", 80, false, "Id"), + new TableParameters("Название", 100, true, "Name"), + new TableParameters("Автор", 180, true, "Author"), + new TableParameters("Обложка", 80, false, "PicturePath"), + new TableParameters("Дата издания", 150, true, "PublicationDate") + }); + + LoadData(); + } + private void LoadData() + { + try + { + _controlDataTable.ClearRows(); + var list = _bookLogic.Read(null); + foreach (var row in list) + { + _controlDataTable.AddRow(row); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } public PluginsConvention() @@ -87,37 +121,7 @@ namespace Library public void ReloadData() { - try - { - var list = _bookLogic.Read(null); - if (list != null) - { - _controlDataTable.ClearRows(); - - _controlDataTable.TableConfiguration(5, new List - { - new TableParameters("Id", 80, false, "Id"), - new TableParameters("Название", 100, true, "Name"), - new TableParameters("Автор", 180, true, "Author"), - new TableParameters("Обложка", 80, false, "PicturePath"), - new TableParameters("Дата издания", 150, true, "PublicationDate") - }); - - foreach (var row in list) - { - _controlDataTable.AddRow(row); - } - } - } - catch (Exception ex) - { - MessageBox.Show( - ex.Message, - "Ошибка", - MessageBoxButtons.OK, - MessageBoxIcon.Error - ); - } + LoadData(); } public bool CreateSimpleDocument(PluginsConventionSaveDocument saveDocument) diff --git a/Plugins/BusinessLogic.dll b/Plugins/BusinessLogic.dll index 3f482f1..79b10fa 100644 Binary files a/Plugins/BusinessLogic.dll and b/Plugins/BusinessLogic.dll differ diff --git a/Plugins/Contracts.dll b/Plugins/Contracts.dll index cc94ced..1f2e840 100644 Binary files a/Plugins/Contracts.dll and b/Plugins/Contracts.dll differ diff --git a/Plugins/DatabaseImplement.dll b/Plugins/DatabaseImplement.dll index a6b4428..23309b8 100644 Binary files a/Plugins/DatabaseImplement.dll and b/Plugins/DatabaseImplement.dll differ diff --git a/Plugins/Library.dll b/Plugins/Library.dll index f4a63da..e96b59f 100644 Binary files a/Plugins/Library.dll and b/Plugins/Library.dll differ diff --git a/Plugins/PluginsConventionLibrary.dll b/Plugins/PluginsConventionLibrary.dll index 236f6b4..e476c2e 100644 Binary files a/Plugins/PluginsConventionLibrary.dll and b/Plugins/PluginsConventionLibrary.dll differ diff --git a/TestView/Plugins/BusinessLogic.dll b/TestView/Plugins/BusinessLogic.dll index 3f482f1..79b10fa 100644 Binary files a/TestView/Plugins/BusinessLogic.dll and b/TestView/Plugins/BusinessLogic.dll differ diff --git a/TestView/Plugins/Contracts.dll b/TestView/Plugins/Contracts.dll index cc94ced..1f2e840 100644 Binary files a/TestView/Plugins/Contracts.dll and b/TestView/Plugins/Contracts.dll differ diff --git a/TestView/Plugins/DatabaseImplement.dll b/TestView/Plugins/DatabaseImplement.dll index a6b4428..23309b8 100644 Binary files a/TestView/Plugins/DatabaseImplement.dll and b/TestView/Plugins/DatabaseImplement.dll differ diff --git a/TestView/Plugins/Library.dll b/TestView/Plugins/Library.dll index f4a63da..e96b59f 100644 Binary files a/TestView/Plugins/Library.dll and b/TestView/Plugins/Library.dll differ diff --git a/TestView/Plugins/PluginsConventionLibrary.dll b/TestView/Plugins/PluginsConventionLibrary.dll index 236f6b4..e476c2e 100644 Binary files a/TestView/Plugins/PluginsConventionLibrary.dll and b/TestView/Plugins/PluginsConventionLibrary.dll differ