Итоговые правки.

This commit is contained in:
ElEgEv 2023-11-03 00:07:27 +04:00
parent 52f2fd6b15
commit 105b576311
2 changed files with 20 additions and 29 deletions

View File

@ -87,7 +87,7 @@ namespace PluginsConventionLibraryNet60
catch (Exception ex)
{
Console.WriteLine($"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> {dllFile}: {ex.Message}");
Console.WriteLine($"Беда с .dll в папке Plugins - {dllFile}: {ex.Message}");
}
}
return plugins;
@ -141,18 +141,21 @@ namespace PluginsConventionLibraryNet60
{
var form = _plugins[_selectedPlugin].GetForm(null);
if (form != null && form.ShowDialog() == DialogResult.OK)
if (form != null)
{
form.ShowDialog();
_plugins[_selectedPlugin].ReloadData();
}
}
private void UpdateElement()
{
var element = _plugins[_selectedPlugin].GetElement;
if (element == null)
{
MessageBox.Show("<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBox.Show("Не выделена запись для обновления", "Ошибка обновления",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@ -160,14 +163,17 @@ namespace PluginsConventionLibraryNet60
var form = _plugins[_selectedPlugin].GetForm(element);
if (form != null && form.ShowDialog() == DialogResult.OK)
if (form != null)
{
form.ShowDialog();
_plugins[_selectedPlugin].ReloadData();
}
}
private void DeleteElement()
{
if (MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
if (MessageBox.Show("Вы точно хотите удалить выбранную запись?", "Внимание!",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
{
@ -178,7 +184,7 @@ namespace PluginsConventionLibraryNet60
if (element == null)
{
MessageBox.Show("<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBox.Show("Не выделена запись для удаления", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@ -201,12 +207,11 @@ namespace PluginsConventionLibraryNet60
FileName = dialog.FileName
}))
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Файл успешно создан!", "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Ошибка сохранения документа", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@ -221,18 +226,18 @@ namespace PluginsConventionLibraryNet60
FileName = dialog.FileName
}))
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Файл успешно создан!", "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Ошибка сохранения документа", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void CreateChartDoc()
{
using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" };
if (dialog.ShowDialog() == DialogResult.OK)
{
if (_plugins[_selectedPlugin].CreateChartDocument(new PluginsConventionSaveDocument()
@ -240,12 +245,11 @@ namespace PluginsConventionLibraryNet60
FileName = dialog.FileName
}))
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Файл успешно создан!", "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Ошибка сохранения документа", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

View File

@ -79,7 +79,6 @@ namespace VisualComponentsForm
return form;
}
}
//получаем список дисциплин (мои перечисления по заданию)
@ -133,14 +132,10 @@ namespace VisualComponentsForm
wordTable.CreateDoc(table);
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
@ -179,14 +174,10 @@ namespace VisualComponentsForm
RowHeight = new double[] { 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 }
});
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
@ -246,14 +237,10 @@ namespace VisualComponentsForm
chart.GenerateChartExcel(excelTable);
MessageBox.Show("Сохарнено успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
{
return false;
}
}