CourseWork_FurnitureFactory/FurnitureFactory/ManagerWebClient/Program.cs

56 lines
2.6 KiB
C#
Raw Normal View History

using FurnitureFactoryBusinessLogic.BusinessLogic;
using FurnitureFactoryBusinessLogic.OfficePackage.Implements;
using FurnitureFactoryBusinessLogic.OfficePackage;
using FurnitureContracts.BusinessLogicsContracts;
using FurnitureContracts.StoragesContracts;
using FurnitureFactoryDataBaseImplements.Implements;
using ManagerWebClient;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddLog4Net("log4net.config");
builder.Services.AddTransient<IManagerStorage, ManagerStorage>();
builder.Services.AddTransient<ISalesSalonsStorage, SalesSalonStorage>();
builder.Services.AddTransient<IHeadsetStorage, HeadsetStorage>();
builder.Services.AddTransient<IOrdersStorage, OrderStorage>();
//builder.Services.AddTransient<IHeadsetModuleStorage, HeadsetModuleStorage>();
//builder.Services.AddTransient<IMasterStorage, MasterStorage>();
//builder.Services.AddTransient<IMaterialStorage, MaterialStorage>();
//builder.Services.AddTransient<IFurnitureStorage, FurnitureStorage>();
builder.Services.AddTransient<IManagerLogic, ManagerLogic>();
builder.Services.AddTransient<ISalesSalonsLogic, SalesSalonLogic>();
builder.Services.AddTransient<IHeadsetLogic, HeadsetLogic>();
builder.Services.AddTransient<IOrderLogic, OrderLogic>();
builder.Services.AddTransient<IHeadsetModuleLogic, HeadsetModuleLogic>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<IMasterLogic, MasterLogic>();
builder.Services.AddTransient<IMaterialLogic, MaterialLogic>();
builder.Services.AddTransient<IFurnitureLogic, FurnitureLogic>();
builder.Services.AddTransient<AbstractSaveToExcelManager, SaveToExcelManager>();
builder.Services.AddTransient<AbstractSaveToWordManager, SaveToWordManager>();
builder.Services.AddTransient<AbstractSaveToPdfManager, SaveToPdfManager>();
builder.Services.AddTransient<AbstractSaveToExcelMaster, SaveToExcelMaster>();
builder.Services.AddTransient<AbstractSaveToWordMaster, SaveToWordMaster>();
builder.Services.AddTransient<AbstractSaveToPdfMaster, SaveToPdfMaster>();
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for orderion scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();