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
|
|
|
|
2023-02-12 16:23:30 +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");
|
|
|
|
});
|
2023-03-25 00:57:08 +04:00
|
|
|
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>();
|
2023-03-25 00:57:08 +04:00
|
|
|
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>();
|
2023-03-23 19:48:59 +04:00
|
|
|
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>();
|
2023-03-25 00:57:08 +04:00
|
|
|
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>();
|
2023-03-23 19:48:59 +04:00
|
|
|
services.AddTransient<FormReportShopListSushi>();
|
2023-03-10 16:43:19 +04:00
|
|
|
services.AddTransient<FormReportOrders>();
|
2023-03-23 19:48:59 +04:00
|
|
|
services.AddTransient<FormReportOrdersGroupedByDate>();
|
2023-02-14 11:25:23 +04:00
|
|
|
services.AddTransient<FormShopSushi>();
|
2023-02-13 23:13:13 +04:00
|
|
|
services.AddTransient<FormShops>();
|
|
|
|
services.AddTransient<FormShop>();
|
2023-03-04 10:34:01 +04:00
|
|
|
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
|
|
|
}
|