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

71 lines
3.0 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>();
2024-04-07 22:12:26 +04:00
services.AddTransient<IClientStorage, ClientStorage>();
2024-06-15 21:15:46 +04:00
services.AddTransient<IShopStorage, ShopStorage>();
2024-04-07 22:12:26 +04:00
2024-03-11 00:46:45 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<ITextileLogic, TextileLogic>();
2024-06-15 21:15:46 +04:00
services.AddTransient<IShopLogic, ShopLogic>();
2024-04-03 01:03:19 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
2024-04-07 22:12:26 +04:00
services.AddTransient<IClientLogic, ClientLogic>();
2024-04-03 01:03:19 +04:00
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-06-15 21:15:46 +04:00
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-06-15 21:15:46 +04:00
services.AddTransient<FormShop>();
services.AddTransient<FormShops>();
services.AddTransient<FormMakeDelivery>();
services.AddTransient<FormTextileSale>();
2024-04-03 01:03:19 +04:00
services.AddTransient<FormReportTextileComponents>();
services.AddTransient<FormReportOrders>();
2024-04-07 22:12:26 +04:00
services.AddTransient<FormClients>();
2024-06-16 12:52:00 +04:00
services.AddTransient<FormReportShopTextiles>();
services.AddTransient<FormReportGroupedOrders>();
2024-03-11 00:46:45 +04:00
}
2024-03-11 00:36:15 +04:00
}
2024-03-11 00:46:45 +04:00
}