DepartmentProject/DepartmentPortal/DepartmentPortalDesctop/Program.cs

36 lines
947 B
C#

using DatabaseCore;
using ModelTools.BusinessLogics;
using ModelTools.Interfaces;
using SecurityBusinessLogic.BusinessLogics;
using System;
using System.Windows.Forms;
namespace DepartmentPortalDesctop
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
UnityContainerConfigurator.PublishService<ISecurityManager, SecurityManager>();
UnityContainerConfigurator.InitServices();
var securityManager = UnityContainerConfigurator.Resolve<ISecurityManager>();
securityManager.CheckStartDataSource();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var form = new FormEnter();
if (form.ShowDialog() == DialogResult.OK && securityManager.IsAuth)
{
Application.Run(UnityContainerConfigurator.Resolve<FormMain>());
}
}
}
}