2024-03-30 14:30:43 +04:00
|
|
|
using BarContracts.BusinessLogicsContracts;
|
|
|
|
using BarContracts.StoragesContracts;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2024-04-21 16:04:37 +04:00
|
|
|
using BarDatabaseImplement.Implements;
|
2024-03-30 14:30:43 +04:00
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NLog.Extensions.Logging;
|
2024-04-27 15:00:40 +04:00
|
|
|
using BarBusinessLogic.OfficePackage.Implements;
|
|
|
|
using BarBusinessLogic.OfficePackage;
|
2024-04-21 16:04:37 +04:00
|
|
|
using BarBusinessLogic.BusinessLogics;
|
2024-03-30 14:30:43 +04:00
|
|
|
|
2024-03-30 14:26:33 +04:00
|
|
|
namespace BarView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2024-03-30 14:30:43 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2024-03-30 14:26:33 +04:00
|
|
|
/// <summary>
|
2024-03-30 14:30:43 +04:00
|
|
|
/// The main entry point for the application.
|
2024-03-30 14:26:33 +04:00
|
|
|
/// </summary>
|
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
|
|
|
// To customize application configuration such as set high DPI settings or default font,
|
2024-03-30 14:30:43 +04:00
|
|
|
// see https://aka.ms/applicationconfiguration.
|
|
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
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<ICocktailStorage, CocktailStorage>();
|
|
|
|
|
|
|
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
services.AddTransient<ICocktailLogic, CocktailLogic>();
|
2024-04-27 15:00:40 +04:00
|
|
|
services.AddTransient<IReportLogic, ReportLogic>();
|
|
|
|
|
|
|
|
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
|
|
|
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
|
|
|
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
|
|
|
|
2024-03-30 14:30:43 +04:00
|
|
|
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormComponent>();
|
|
|
|
services.AddTransient<FormComponents>();
|
|
|
|
services.AddTransient<FormCreateOrder>();
|
|
|
|
services.AddTransient<FormCocktail>();
|
|
|
|
services.AddTransient<FormCocktailComponent>();
|
|
|
|
services.AddTransient<FormCocktails>();
|
2024-04-27 15:00:40 +04:00
|
|
|
services.AddTransient<FormReportCocktailComponents>();
|
|
|
|
services.AddTransient<FormReportOrders>();
|
|
|
|
|
2024-03-30 14:26:33 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|