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

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

View File

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