83 lines
3.5 KiB
C#
Raw Normal View History

2023-01-31 15:23:18 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
using SushiBarBusinessLogic.BusinessLogics;
2023-03-10 16:43:19 +04:00
using SushiBarBusinessLogic.OfficePackage.Implements;
using SushiBarBusinessLogic.OfficePackage;
2023-01-31 15:23:18 +04:00
using SushiBarContracts.BusinessLogicsContracts;
using SushiBarContracts.StoragesContracts;
2023-02-27 22:16:28 +04:00
using SushiBarDatabaseImplement.Implements;
2023-01-31 15:23:18 +04:00
namespace SushiBarView
2023-01-28 22:14:29 +04:00
{
internal static class Program
{
2023-01-31 15:23:18 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2023-01-28 22:14: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-01-31 15:23:18 +04:00
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
2023-01-28 22:14:29 +04:00
}
2023-01-31 15:23:18 +04:00
private static void ConfigureServices(ServiceCollection services)
{
services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
});
services.AddTransient<IClientStorage, ClientStorage>();
2023-01-31 15:23:18 +04:00
services.AddTransient<IIngredientStorage, IngredientStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<ISushiStorage, SushiStorage>();
2023-04-10 21:11:09 +04:00
services.AddTransient<IImplementerStorage, ImplementerStorage>();
2023-03-10 16:43:19 +04:00
2023-02-13 23:13:13 +04:00
services.AddTransient<IShopStorage, ShopStorage>();
services.AddTransient<IClientLogic, ClientLogic>();
2023-01-31 15:23:18 +04:00
services.AddTransient<IIngredientLogic, IngredientLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<ISushiLogic, SushiLogic>();
2023-03-10 16:43:19 +04:00
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<IShopLogic, ShopLogic>();
2023-04-10 21:11:09 +04:00
services.AddTransient<IImplementerLogic, ImplementerLogic>();
2023-04-10 22:46:23 +04:00
services.AddTransient<IWorkProcess, WorkModeling>();
2023-03-10 16:43:19 +04:00
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2023-01-31 15:23:18 +04:00
services.AddTransient<FormMain>();
services.AddTransient<FormClients>();
2023-01-31 15:23:18 +04:00
services.AddTransient<FormIngredient>();
services.AddTransient<FormIngredients>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormSushi>();
services.AddTransient<FormSushiIngredients>();
services.AddTransient<FormListSushi>();
2023-03-10 16:43:19 +04:00
services.AddTransient<FormReportSushiIngredients>();
services.AddTransient<FormReportShopListSushi>();
2023-03-10 16:43:19 +04:00
services.AddTransient<FormReportOrders>();
services.AddTransient<FormReportOrdersGroupedByDate>();
services.AddTransient<FormShopSushi>();
2023-02-13 23:13:13 +04:00
services.AddTransient<FormShops>();
services.AddTransient<FormShop>();
services.AddTransient<FormSellSushi>();
2023-04-10 22:46:23 +04:00
services.AddTransient<FormImplementers>();
services.AddTransient<FormImplementer>();
2023-01-31 15:23:18 +04:00
}
2023-01-28 22:14:29 +04:00
}
2023-01-31 15:23:18 +04:00
}