63 lines
2.3 KiB
C#
Raw Normal View History

2023-02-23 20:14:56 +04:00
using AbstractShopBusinessLogic.BusinessLogics;
2023-02-24 17:53:27 +04:00
using AbstractShopBusinessLogic.OfficePackage;
using AbstractShopBusinessLogic.OfficePackage.Implements;
2023-02-23 20:14:56 +04:00
using AbstractShopContracts.BusinessLogicsContracts;
using AbstractShopContracts.StoragesContracts;
2023-02-24 12:45:01 +04:00
using AbstractShopDatabaseImplement.Implements;
2023-02-23 20:14:56 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
2023-02-23 10:56:29 +04:00
namespace AbstractShopView
{
internal static class Program
{
2023-02-23 20:14:56 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2023-02-23 10:56:29 +04:00
/// <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();
2023-02-23 20:14:56 +04:00
// Application.Run(new Form1());
2023-02-23 10:56:29 +04:00
}
2023-02-23 20:14:56 +04:00
private static void ConfigureServices(ServiceCollection services)
{
services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
});
2023-02-24 21:42:29 +04:00
services.AddTransient<IClientStorage, ClientStorage>();
2023-02-23 20:14:56 +04:00
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IProductStorage, ProductStorage>();
2023-02-24 21:42:29 +04:00
services.AddTransient<IClientLogic, ClientLogic>();
2023-02-23 20:14:56 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IProductLogic, ProductLogic>();
2023-02-24 17:53:27 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2023-02-23 20:14:56 +04:00
services.AddTransient<FormMain>();
2023-02-24 21:42:29 +04:00
services.AddTransient<FormClients>();
2023-02-23 20:14:56 +04:00
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormProduct>();
services.AddTransient<FormProductComponent>();
2023-02-24 17:53:27 +04:00
services.AddTransient<FormReportProductComponents>();
services.AddTransient<FormReportOrders>();
2023-02-23 20:14:56 +04:00
}
}
2023-02-23 10:56:29 +04:00
}