DepartmentProject/DepartmentPortal/Common/DesktopTools/BusinessLogics/ErrorMessanger.cs

30 lines
932 B
C#
Raw Normal View History

2021-03-28 00:23:01 +04:00
using DesktopTools.Forms;
using System.Collections.Generic;
using System.Windows.Forms;
namespace DesktopTools.BusinessLogics
{
/// <summary>
/// Класс, отвечающий за вывод сообщения с ошибками
/// </summary>
public static class ErrorMessanger
{
/// <summary>
/// Вывод сообщения
/// </summary>
/// <param name="text"></param>
/// <param name="result"></param>
public static void PrintErrorMessage(string text, List<KeyValuePair<string, string>> result)
{
if (result.Count == 1)
{
MessageBox.Show(result[0].Value, result[0].Key, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
FormDisplayErrors form = new FormDisplayErrors();
form.LoadData(text, result);
}
}
}
}