59 lines
2.2 KiB
C#
59 lines
2.2 KiB
C#
using System;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using PersonnelDepartmentBusinessLogic.BusinessLogics;
|
|
using PersonnelDepartmentContracts.BusinessLogicContracts;
|
|
using PersonnelDepartmentContracts.StoragesContracts;
|
|
using PersonnelDepartmentDatabaseImplement.Implements;
|
|
using PersonnelTypeContracts.StoragesContracts;
|
|
|
|
namespace PersonnelDepartmentView
|
|
{
|
|
internal static class Program
|
|
{
|
|
private static ServiceProvider? _serviceProvider;
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
// To customize application configuration such as set high DPI settings or default font,
|
|
// see https://aka.ms/applicationconfiguration.
|
|
ApplicationConfiguration.Initialize();
|
|
var services = new ServiceCollection();
|
|
ConfigureServices(services);
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
Application.Run(_serviceProvider.GetRequiredService<FormDeals>());
|
|
}
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
{
|
|
services.AddTransient<IDealLogic, DealLogic>();
|
|
services.AddTransient<IDepartmentLogic, DepartmentLogic>();
|
|
services.AddTransient<IEmployeeLogic, EmployeeLogic>();
|
|
services.AddTransient<IPositionLogic, PositionLogic>();
|
|
services.AddTransient<ITypeLogic, TypeLogic>();
|
|
services.AddTransient<IBackUpLogic, BackUpLogic>();
|
|
|
|
services.AddTransient<IDealStorage, DealStorage>();
|
|
services.AddTransient<IDepartmentStorage, DepartmentStorage>();
|
|
services.AddTransient<IEmployeeStorage, EmployeeStorage>();
|
|
services.AddTransient<ITypeStorage, TypeStorage>();
|
|
services.AddTransient<IPositionStorage, PositionStorage>();
|
|
services.AddTransient<IBackUpInfo, BackUpInfo>();
|
|
|
|
services.AddTransient<FormDeal>();
|
|
services.AddTransient<FormDeals>();
|
|
services.AddTransient<FormDepartment>();
|
|
services.AddTransient<FormDepartments>();
|
|
services.AddTransient<FormEmployee>();
|
|
services.AddTransient<FormEmployees>();
|
|
services.AddTransient<FormPosition>();
|
|
services.AddTransient<FormPositions>();
|
|
services.AddTransient<FormType>();
|
|
services.AddTransient<FormTypes>();
|
|
services.AddTransient<FormGeneration>();
|
|
}
|
|
}
|
|
} |