60 lines
2.7 KiB
C#
60 lines
2.7 KiB
C#
using AccountingWarehouseProductsBusinessLogic.BusinessLogic;
|
|
using AccountingWarehouseProductsContracts.BusinessLogicsContracts;
|
|
using AccountingWarehouseProductsContracts.StoragesContracts;
|
|
using AccountingWarehouseProductsDatabaseImplement.Implements;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace AccountingWarehouseProductsView
|
|
{
|
|
internal static class Program
|
|
{
|
|
private static ServiceProvider? _serviceProvider;
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
|
/// <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();
|
|
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>();
|
|
}
|
|
}
|
|
} |