71 lines
3.2 KiB
C#
Raw Normal View History

2024-02-27 23:44:38 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
using SoftwareInstallationBusinessLogic.BusinessLogics;
2024-04-10 08:56:56 +04:00
using SoftwareInstallationBusinessLogic.OfficePackage.Implements;
using SoftwareInstallationBusinessLogic.OfficePackage;
2024-02-27 23:44:38 +04:00
using SoftwareInstallationContracts.BusinessLogicsContracts;
using SoftwareInstallationContracts.StoragesContracts;
2024-03-27 08:53:00 +04:00
using SoftwareInstallationDatabaseImplement;
2024-02-27 23:44:38 +04:00
using SoftwareInstallationView;
2024-04-29 13:44:53 +04:00
using SoftwareInstallationDatabaseImplement.Implements;
2024-02-27 23:44:38 +04:00
namespace SoftwareInstallation
2024-02-14 09:06:45 +04:00
{
internal static class Program
{
2024-02-27 23:44:38 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2024-02-14 09:06:45 +04:00
/// <summary>
2024-03-13 08:34:03 +04:00
/// The main entry point for the application.
2024-02-14 09:06:45 +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.
2024-03-13 08:34:03 +04:00
ApplicationConfiguration.Initialize();
2024-02-27 23:44:38 +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<IPackageStorage, PackageStorage>();
2024-04-29 13:44:53 +04:00
services.AddTransient<IClientStorage, ClientStorage>();
2024-05-05 16:02:57 +04:00
services.AddTransient<IImplementerStorage, ImplementerStorage>();
2024-04-10 08:56:56 +04:00
2024-02-27 23:44:38 +04:00
services.AddTransient<IComponentLogic, ComponentLogic>();
2024-04-29 13:44:53 +04:00
services.AddTransient<IClientLogic, ClientLogic>();
2024-02-27 23:44:38 +04:00
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPackageLogic, PackageLogic>();
2024-04-10 08:56:56 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
2024-05-05 16:02:57 +04:00
services.AddTransient<IImplementerLogic, ImplementerLogic>();
services.AddTransient<IWorkProcess, WorkModeling>();
2024-04-10 08:56:56 +04:00
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-02-27 23:44:38 +04:00
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormPackage>();
services.AddTransient<FormPackageComponent>();
services.AddTransient<FormPackages>();
2024-05-05 16:02:57 +04:00
services.AddTransient<FormImplementer>();
services.AddTransient<FormImplementers>();
2024-04-10 08:56:56 +04:00
services.AddTransient<FormReportPackageComponents>();
services.AddTransient<FormReportOrders>();
2024-02-14 09:06:45 +04:00
}
}
}