ISEbd_21_Kuklew_M.I._Softwa.../SoftwareInstallation/Program.cs

75 lines
3.1 KiB
C#
Raw Normal View History

2024-04-07 16:54:02 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
2024-05-11 21:16:59 +04:00
using SoftwareInstallationBusinessLogic.BusinessLogic;
2024-04-07 17:40:43 +04:00
using SoftwareInstallationBusinessLogic.OfficePackage.Implements;
using SoftwareInstallationBusinessLogic.OfficePackage;
using SoftwareInstallationContracts.BusinessLogicsContracts;
using SoftwareInstallationContracts.StoragesContracts;
using SoftwareInstallationDatabaseImplement.Implements;
using System;
2024-05-11 21:30:00 +04:00
using SoftwareInstallation.Forms;
2024-04-07 16:54:02 +04:00
2024-04-07 17:40:43 +04:00
namespace SoftwareInstallationView
2024-04-07 16:21:01 +04:00
{
internal static class Program
{
2024-04-07 16:54:02 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2024-04-07 16:21:01 +04:00
/// <summary>
2024-04-07 17:05:30 +04:00
/// The main entry point for the application.
2024-04-07 16:21:01 +04:00
/// </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-04-07 16:54:02 +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");
});
2024-04-07 17:40:43 +04:00
2024-04-07 16:54:02 +04:00
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IPackageStorage, PackageStorage>();
2024-04-07 17:40:43 +04:00
2024-04-07 16:54:02 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPackageLogic, PackageLogic>();
2024-04-07 17:40:43 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
2024-05-11 21:30:00 +04:00
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<IClientStorage, ClientStorage>();
services.AddTransient<IImplementerLogic, ImplementerLogic>();
services.AddTransient<IImplementerStorage, ImplementerStorage>();
services.AddTransient<IWorkProcess, WorkModeling>();
2024-04-07 17:40:43 +04:00
2024-05-11 21:30:00 +04:00
services.AddTransient<AbstractSaveToWord, SaveToWord>();
2024-04-07 17:40:43 +04:00
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-04-07 17:05:30 +04:00
services.AddTransient<FormMain>();
2024-04-07 16:54:02 +04:00
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
2024-04-07 17:40:43 +04:00
services.AddTransient<FormSoftware>();
2024-04-07 16:54:02 +04:00
services.AddTransient<FormPackageComponent>();
2024-04-07 17:40:43 +04:00
services.AddTransient<FormSoftwares>();
services.AddTransient<FormReportSoftwareComponents>();
services.AddTransient<FormReportOrders>();
2024-05-11 21:16:59 +04:00
services.AddTransient<FormClients>();
2024-05-11 21:30:00 +04:00
services.AddTransient<ImplementersForm>();
services.AddTransient<ImplementerForm>();
2024-05-11 21:16:59 +04:00
}
2024-05-11 21:30:00 +04:00
}
2024-04-07 16:21:01 +04:00
}