using DesktopTools.BusinessLogics;
using SecurityBusinessLogic.BusinessLogics;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DepartmentPortalDesctop
{
///
/// Форма входа в систему
///
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)
{
ErrorMessanger.PrintErrorMessage("При аутентфикации возникла ошибка: ", new List> { new KeyValuePair("Аутентфикация", ex.Message) });
}
}
}
}