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

57 lines
2.2 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-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-03-30 23:33:20 +04:00
services.AddTransient<IShopStorage, ShopStorage>();
2024-04-15 17:10:01 +04:00
2024-03-11 00:46:45 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<ITextileLogic, TextileLogic>();
2024-03-30 23:33:20 +04:00
services.AddTransient<IShopLogic, ShopLogic>();
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-03-30 23:33:20 +04:00
services.AddTransient<FormShop>();
services.AddTransient<FormShops>();
services.AddTransient<FormMakeDelivery>();
2024-04-15 17:10:01 +04:00
services.AddTransient<FormTextileSale>();
}
2024-03-11 00:46:45 +04:00
2024-03-11 00:36:15 +04:00
}
2024-03-11 00:46:45 +04:00
}