PIbd-21_Shanygin_A.V_Garmen.../GarmentFactory/GarmentFactoryView/Program.cs

57 lines
2.4 KiB
C#
Raw Normal View History

2024-03-11 00:46:45 +04:00
using GarmentFactoryBusinessLogic.BusinessLogics;
using GarmentFactoryContracts.BusinessLogicsContracts;
using GarmentFactoryContracts.StoragesContracts;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
2024-03-19 23:39:33 +04:00
using GarmentFactoryDatabaseImplement.Implements;
2024-04-03 01:03:19 +04:00
using GarmentFactoryBusinessLogic.OfficePackage.Implements;
using GarmentFactoryBusinessLogic.OfficePackage;
2024-03-11 00:46:45 +04:00
using System.Drawing;
2024-03-11 00:36:15 +04:00
namespace GarmentFactoryView
{
internal static class Program
{
2024-03-11 00:46:45 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2024-03-11 00:36:15 +04:00
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
2024-03-11 00:46:45 +04:00
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
2024-03-11 00:36:15 +04:00
}
2024-03-11 00:46:45 +04:00
private static void ConfigureServices(ServiceCollection services)
{
services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
});
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<ITextileStorage, TextileStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<ITextileLogic, TextileLogic>();
2024-04-03 01:03:19 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-03-11 00:46:45 +04:00
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormTextile>();
services.AddTransient<FormTextileComponent>();
services.AddTransient<FormTextiles>();
2024-04-03 01:03:19 +04:00
services.AddTransient<FormReportTextileComponents>();
services.AddTransient<FormReportOrders>();
2024-03-11 00:46:45 +04:00
}
2024-03-11 00:36:15 +04:00
}
2024-03-11 00:46:45 +04:00
}