SUBD_PIbd-21_Balberova_D.N./BeautySaloon/BeautySaloonView/Program.cs

60 lines
2.5 KiB
C#
Raw Normal View History

2023-03-28 17:32:55 +04:00
using BeautySaloonBusinessLogic;
using BeautySaloonContracts.BusinessLogicsContracts;
using BeautySaloonContracts.StoragesContracts;
2023-03-29 20:00:53 +04:00
using BeautySaloonDatabaseImplement.Implements;
2023-03-28 17:32:55 +04:00
using Microsoft.Extensions.DependencyInjection;
2023-03-27 23:58:06 +04:00
namespace BeautySaloonView
{
internal static class Program
{
2023-03-28 17:32:55 +04:00
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
2023-03-27 23:58:06 +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-03-28 17:32:55 +04:00
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
}
private static void ConfigureServices(ServiceCollection services)
{
2023-03-29 20:00:53 +04:00
services.AddTransient<IClientStorage, ClientStorage>();
services.AddTransient<IEmployeeStorage, EmployeeStorage>();
2023-03-28 17:32:55 +04:00
services.AddTransient<IOrderStorage, OrderStorage>();
2023-03-29 20:00:53 +04:00
services.AddTransient<IPositionStorage, PositionStorage>();
services.AddTransient<IServiceStorage, ServiceStorage>();
2023-03-28 17:32:55 +04:00
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<IEmployeeLogic, EmployeeLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPositionLogic, PositionLogic>();
services.AddTransient<IServiceLogic, ServiceLogic>();
2023-03-29 20:00:53 +04:00
services.AddTransient<FormClient>();
services.AddTransient<FormClientOrders>();
services.AddTransient<FormClients>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormEmployee>();
services.AddTransient<FormEmployees>();
2023-03-28 17:32:55 +04:00
services.AddTransient<FormMain>();
2023-03-29 20:00:53 +04:00
services.AddTransient<FormOrderServices>();
services.AddTransient<FormPosition>();
services.AddTransient<FormPositions>();
services.AddTransient<FormService>();
services.AddTransient<FormServices>();
2023-03-30 02:29:40 +04:00
services.AddTransient<FormTest>();
2023-03-30 13:59:00 +04:00
services.AddTransient<FormReportServices>();
2023-03-27 23:58:06 +04:00
}
}
}