2024-05-01 22:21:11 +04:00
|
|
|
using AccountingWarehouseProductsBusinessLogic.BusinessLogic;
|
|
|
|
using AccountingWarehouseProductsContracts.BusinessLogicsContracts;
|
|
|
|
using AccountingWarehouseProductsContracts.StoragesContracts;
|
|
|
|
using AccountingWarehouseProductsDatabaseImplement.Implements;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
2024-04-21 12:33:09 +04:00
|
|
|
namespace AccountingWarehouseProductsView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2024-05-01 22:21:11 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2024-04-21 12:33:09 +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();
|
2024-05-01 22:21:11 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddTransient<IProductStorage, ProductStorage>();
|
|
|
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
|
|
|
services.AddTransient<IShipmentStorage, ShipmentStorage>();
|
|
|
|
services.AddTransient<IStandStorage, StandStorage>();
|
|
|
|
services.AddTransient<ISupplierStorage, SupplierStorage>();
|
|
|
|
services.AddTransient<IWarehouseStorage, WarehouseStorage>();
|
|
|
|
|
|
|
|
services.AddTransient<IProductLogic, ProductLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
services.AddTransient<IShipmentLogic, ShipmentLogic>();
|
|
|
|
services.AddTransient<IStandLogic, StandLogic>();
|
|
|
|
services.AddTransient<ISupplierLogic, SupplierLogic>();
|
|
|
|
services.AddTransient<IWarehouseLogic, WarehouseLogic>();
|
|
|
|
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormProduct>();
|
|
|
|
services.AddTransient<FormProducts>();
|
|
|
|
services.AddTransient<FormSupplier>();
|
|
|
|
services.AddTransient<FormSuppliers>();
|
|
|
|
services.AddTransient<FormShipment>();
|
|
|
|
services.AddTransient<FormShipments>();
|
|
|
|
services.AddTransient<FormStand>();
|
|
|
|
services.AddTransient<FormStands>();
|
|
|
|
services.AddTransient<FormWarehouse>();
|
|
|
|
services.AddTransient<FormWarehouses>();
|
|
|
|
services.AddTransient<FormCreateOrder>();
|
|
|
|
services.AddTransient<FormOrderProduct>();
|
|
|
|
services.AddTransient<FormWarehouseProduct>();
|
2024-04-21 12:33:09 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|