All working! :) :) :)

This commit is contained in:
ElEgEv 2023-11-03 00:22:31 +04:00
parent 105b576311
commit 85be301862
2 changed files with 30 additions and 25 deletions

View File

@ -151,24 +151,25 @@ namespace PluginsConventionLibraryNet60
private void UpdateElement() private void UpdateElement()
{ {
var element = _plugins[_selectedPlugin].GetElement; try
if (element == null)
{ {
MessageBox.Show("Íå âûäåëåíà çàïèñü äëÿ îáíîâëåíèÿ", "Îøèáêà îáíîâëåíèÿ", var element = _plugins[_selectedPlugin].GetElement;
MessageBoxButtons.OK, MessageBoxIcon.Error);
var form = _plugins[_selectedPlugin].GetForm(element);
if (form != null)
{
form.ShowDialog();
_plugins[_selectedPlugin].ReloadData();
}
}
catch
{
MessageBox.Show("Íĺ âűäĺëĺíŕ çŕďčńü äë˙ îáíîâëĺíč˙", "Îřčáęŕ îáíîâëĺíč˙", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
var form = _plugins[_selectedPlugin].GetForm(element);
if (form != null)
{
form.ShowDialog();
_plugins[_selectedPlugin].ReloadData();
}
} }
private void DeleteElement() private void DeleteElement()
@ -180,20 +181,21 @@ namespace PluginsConventionLibraryNet60
return; return;
} }
var element = _plugins[_selectedPlugin].GetElement; try
if (element == null)
{ {
MessageBox.Show("Íå âûäåëåíà çàïèñü äëÿ óäàëåíèÿ", "Îøèáêà", var element = _plugins[_selectedPlugin].GetElement;
MessageBoxButtons.OK, MessageBoxIcon.Error);
if (_plugins[_selectedPlugin].DeleteElement(element))
{
_plugins[_selectedPlugin].ReloadData();
}
}
catch
{
MessageBox.Show("Íĺ âűäĺëĺíŕ çŕďčńü äë˙ óäŕëĺíč˙", "Îřčáęŕ", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
if (_plugins[_selectedPlugin].DeleteElement(element))
{
_plugins[_selectedPlugin].ReloadData();
}
} }
private void CreateSimpleDoc() private void CreateSimpleDoc()
@ -215,6 +217,7 @@ namespace PluginsConventionLibraryNet60
} }
} }
} }
private void CreateTableDoc() private void CreateTableDoc()
{ {
using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
@ -234,6 +237,7 @@ namespace PluginsConventionLibraryNet60
} }
} }
} }
private void CreateChartDoc() private void CreateChartDoc()
{ {
using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" };

View File

@ -54,6 +54,7 @@ namespace VisualComponentsForm
get get
{ {
int Id = GetSelectedId(); int Id = GetSelectedId();
byte[] bytes = new byte[16]; byte[] bytes = new byte[16];
BitConverter.GetBytes(Id).CopyTo(bytes, 0); BitConverter.GetBytes(Id).CopyTo(bytes, 0);