DepartmentProject/DepartmentPortal/DepartmentPortalDesctop/FormEnter.cs

35 lines
922 B
C#
Raw Normal View History

2021-03-28 00:23:01 +04:00
using DesktopTools.BusinessLogics;
using SecurityBusinessLogic.BusinessLogics;
using System;
2021-03-28 00:23:01 +04:00
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DepartmentPortalDesctop
{
/// <summary>
/// Форма входа в систему
/// </summary>
public partial class FormEnter : Form
{
public FormEnter()
{
InitializeComponent();
}
private void ButtonEnter_Click(object sender, EventArgs e)
{
try
{
Task.WaitAll(Task.Run(async () => await UserManager.GetInstance.LoginAsync(textBoxLogin.Text, textBoxPassword.Text)));
DialogResult = DialogResult.OK;
Close();
}
catch (Exception ex)
{
2021-03-28 00:23:01 +04:00
ErrorMessanger.PrintErrorMessage("При аутентфикации возникла ошибка: ", new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("Аутентфикация", ex.Message) });
}
}
}
}