74 lines
3.2 KiB
C#
Raw Normal View History

using TypographyBusinessLogic.BusinessLogics;
using TypographyContracts.BusinessLogicsContracts;
using TypographyContracts.StoragesContracts;
2024-03-10 21:20:18 +04:00
using TypographyDatabaseImplement.Implements;
2024-02-12 12:46:44 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
2024-03-25 01:48:14 +04:00
using TypographyBusinessLogic.OfficePackage.Implements;
using TypographyBusinessLogic.OfficePackage;
using AbstractShopView;
2024-04-22 06:54:28 +04:00
using TypographyDatabaseImplements.Implements;
2024-02-12 12:46:44 +04:00
namespace TypographyView
2024-02-12 12:12:37 +04:00
{
internal static class Program
{
2024-02-12 12:46:44 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2024-02-12 12:12:37 +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();
2024-02-12 12:46:44 +04:00
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
}
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<IPrintedStorage, PrintedStorage>();
services.AddTransient<IClientStorage, TypographyDatabaseImplements.Implements.ClientStorage>();
2024-04-22 06:54:28 +04:00
services.AddTransient<IImplementerStorage, ImplementerStorage>();
2024-02-12 12:46:44 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPrintedLogic, PrintedLogic>();
2024-03-25 01:48:14 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<IClientLogic, ClientLogic>();
2024-04-22 06:54:28 +04:00
services.AddTransient<IImplementerLogic, ImplementerLogic>();
2024-03-25 01:48:14 +04:00
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-04-22 06:54:28 +04:00
services.AddTransient<IWorkProcess, WorkModeling>();
2024-02-12 12:46:44 +04:00
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormPrinted>();
services.AddTransient<FormPrintedComponent>();
services.AddTransient<FormPrinteds>();
2024-03-25 01:48:14 +04:00
services.AddTransient<FormReportPrintedComponents>();
services.AddTransient<FormReportOrders>();
services.AddTransient<FormClients>();
2024-04-22 06:54:28 +04:00
services.AddTransient<FormImplementers>();
services.AddTransient<FormImplementer>();
2024-02-12 12:12:37 +04:00
}
}
}