повторная аутентификация

This commit is contained in:
kotcheshir73 2021-04-02 20:53:03 +04:00
parent ba47e48eeb
commit ed1f4cf07e
2 changed files with 17 additions and 4 deletions

View File

@ -37,6 +37,7 @@ namespace DepartmentPortalDesctop
}
catch (Exception ex)
{
DialogResult = DialogResult.Cancel;
ErrorMessanger.PrintErrorMessage("При аутентфикации возникла ошибка: ", new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("Аутентфикация", ex.Message) });
}
}

View File

@ -24,11 +24,23 @@ namespace DepartmentPortalDesctop
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var form = new FormEnter();
if (form.ShowDialog() == DialogResult.OK && securityManager.IsAuth)
int counter = 3;
while (counter > 0)
{
Application.Run(new FormMain());
var form = new FormEnter();
if (form.ShowDialog() == DialogResult.OK)
{
break;
}
counter--;
}
if (counter > 0)
{
if (securityManager.IsAuth)
{
Application.Run(new FormMain());
}
}
}
}