DepartmentProject/DepartmentPortal/DepartmentPortalDesctop/ErrorMessanger.cs

29 lines
749 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.Generic;
using System.Windows.Forms;
namespace DepartmentPortalDesctop
{
/// <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);
}
}
}
}