86 lines
3.6 KiB
C#
Raw Normal View History

2024-02-21 11:04:46 +04:00
using AutoWorkshopBusinessLogic.BusinessLogics;
2024-04-03 10:26:18 +04:00
using AutoWorkshopBusinessLogic.OfficePackage.Implements;
using AutoWorkshopBusinessLogic.OfficePackage;
2024-02-21 10:36:30 +04:00
using AutoWorkshopContracts.BusinessLogicContracts;
2024-04-09 22:58:05 +04:00
using AutoWorkshopContracts.BusinessLogicsContracts;
2024-02-21 10:36:30 +04:00
using AutoWorkshopContracts.StoragesContracts;
2024-03-20 11:06:47 +04:00
using AutoWorkshopDatabaseImplement.Implements;
2024-02-21 10:36:30 +04:00
using AutoWorkshopView.Forms;
2024-04-09 22:58:05 +04:00
using AutoWorkshopView.Forms.Shop;
2024-02-21 10:36:30 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
2024-02-21 11:04:46 +04:00
using NLog.Extensions.Logging;
2024-04-16 21:33:18 +04:00
using AutoWorkshopContracts.BusinessLogicsContracts;
2024-02-21 10:36:30 +04:00
2024-02-20 23:51:24 +04:00
namespace AutoWorkshopView
2024-02-06 22:59:42 +04:00
{
internal static class Program
{
2024-02-21 10:36:30 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2024-02-06 22:59:42 +04:00
[STAThread]
static void Main()
{
2024-02-21 11:04:46 +04:00
ApplicationConfiguration.Initialize();
2024-02-21 10:36:30 +04:00
var Services = new ServiceCollection();
ConfigureServices(Services);
2024-02-21 11:04:46 +04:00
_serviceProvider = Services.BuildServiceProvider();
2024-02-21 10:36:30 +04:00
Application.Run(_serviceProvider.GetRequiredService<MainForm>());
}
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>();
2024-02-21 11:04:46 +04:00
Services.AddTransient<IRepairStorage, RepairStorage>();
2024-04-09 22:58:05 +04:00
Services.AddTransient<IShopStorage, ShopStorage>();
2024-05-14 23:43:30 +04:00
Services.AddTransient<IClientStorage, ClientStorage>();
2024-04-16 21:33:18 +04:00
Services.AddTransient<IClientStorage, ClientStorage>();
Services.AddTransient<IImplementerStorage, ImplementerStorage>();
2024-02-21 10:36:30 +04:00
Services.AddTransient<IComponentLogic, ComponentLogic>();
Services.AddTransient<IOrderLogic, OrderLogic>();
2024-02-21 11:04:46 +04:00
Services.AddTransient<IRepairLogic, RepairLogic>();
2024-04-03 10:26:18 +04:00
Services.AddTransient<IReportLogic, ReportLogic>();
2024-05-14 22:29:05 +04:00
Services.AddTransient<IShopLogic, ShopLogic>();
2024-05-14 23:43:30 +04:00
Services.AddTransient<IClientLogic, ClientLogic>();
2024-04-11 14:21:59 +04:00
Services.AddTransient<IClientLogic, ClientLogic>();
2024-04-16 21:33:18 +04:00
Services.AddTransient<IImplementerLogic, ImplementerLogic>();
Services.AddTransient<IWorkProcess, WorkModeling>();
2024-04-03 10:26:18 +04:00
2024-04-11 14:21:59 +04:00
Services.AddTransient<AbstractSaveToWord, SaveToWord>();
2024-04-03 10:26:18 +04:00
Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2024-03-19 21:18:58 +04:00
2024-02-21 10:36:30 +04:00
Services.AddTransient<MainForm>();
2024-02-21 11:04:46 +04:00
Services.AddTransient<FormComponent>();
Services.AddTransient<FormComponents>();
Services.AddTransient<FormCreateOrder>();
Services.AddTransient<FormRepair>();
Services.AddTransient<FormRepairComponent>();
Services.AddTransient<FormRepairs>();
2024-04-09 22:58:05 +04:00
Services.AddTransient<FormShop>();
Services.AddTransient<FormShops>();
Services.AddTransient<FormCreateSupply>();
2024-04-10 00:26:00 +04:00
Services.AddTransient<FormSellRepair>();
2024-04-03 10:26:18 +04:00
Services.AddTransient<FormReportRepairComponents>();
Services.AddTransient<FormReportOrders>();
2024-05-13 22:38:52 +04:00
Services.AddTransient<FormReportShop>();
Services.AddTransient<FormReportGroupedOrders>();
2024-04-11 14:21:59 +04:00
Services.AddTransient<FormClients>();
2024-04-16 21:33:18 +04:00
Services.AddTransient<FormImplementers>();
Services.AddTransient<FormImplementer>();
}
2024-02-06 22:59:42 +04:00
}
2024-02-20 23:51:24 +04:00
}