2022-03-18 22:55:48 +04:00
|
|
|
using CoreDatabase;
|
2021-03-26 20:09:52 +04:00
|
|
|
using System;
|
|
|
|
using System.Windows.Forms;
|
2022-03-19 23:06:06 +04:00
|
|
|
using ToolsModule.DependencyManagment;
|
|
|
|
using ToolsModule.Interfaces;
|
2021-03-26 20:09:52 +04:00
|
|
|
|
|
|
|
namespace DepartmentPortalDesctop
|
|
|
|
{
|
2022-03-19 23:06:06 +04:00
|
|
|
static class Program
|
2021-03-26 20:09:52 +04:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The main entry point for the application.
|
|
|
|
/// </summary>
|
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
2021-03-28 19:48:15 +04:00
|
|
|
DependencyManager.Instance.RegisterType<ISecurityManager, SecurityManager>();
|
|
|
|
DependencyManager.InitDependency();
|
2021-03-26 20:09:52 +04:00
|
|
|
|
2021-03-28 19:48:15 +04:00
|
|
|
var securityManager = DependencyManager.Instance.Resolve<ISecurityManager>();
|
2021-03-28 00:15:01 +04:00
|
|
|
securityManager.CheckStartDataSource();
|
|
|
|
|
2021-03-26 20:09:52 +04:00
|
|
|
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
2021-04-02 20:53:03 +04:00
|
|
|
int counter = 3;
|
|
|
|
while (counter > 0)
|
|
|
|
{
|
|
|
|
var form = new FormEnter();
|
|
|
|
if (form.ShowDialog() == DialogResult.OK)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
counter--;
|
|
|
|
}
|
2021-03-26 20:09:52 +04:00
|
|
|
|
2021-04-02 20:53:03 +04:00
|
|
|
if (counter > 0)
|
2021-03-26 20:09:52 +04:00
|
|
|
{
|
2021-04-02 20:53:03 +04:00
|
|
|
if (securityManager.IsAuth)
|
|
|
|
{
|
|
|
|
Application.Run(new FormMain());
|
|
|
|
}
|
2021-03-26 20:09:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|