2023-05-24 21:14:10 +04:00
|
|
|
using ComputerShopBusinessLogic.BusinessLogics;
|
|
|
|
using ComputerShopBusinessLogic.OfficePackage;
|
|
|
|
using ComputerShopBusinessLogic.OfficePackage.Implements;
|
2023-04-07 18:59:41 +04:00
|
|
|
using ComputerShopClientApp;
|
2023-05-24 21:14:10 +04:00
|
|
|
using ComputerShopContracts.BusinessLogicContracts;
|
|
|
|
using ComputerShopContracts.StorageContracts;
|
|
|
|
using ComputerShopDatabaseImplement.Implements;
|
2023-04-07 18:59:41 +04:00
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
2023-05-24 21:14:10 +04:00
|
|
|
builder.Services.AddTransient<IComponentStorage, ComponentStorage>();
|
|
|
|
builder.Services.AddTransient<ISupplyStorage, SupplyStorage>();
|
|
|
|
builder.Services.AddTransient<IAssemblyStorage, AssemblyStorage>();
|
|
|
|
builder.Services.AddTransient<IEquipmentReceivingStorage, EquipmentReceivingStorage>();
|
|
|
|
builder.Services.AddTransient<IPurchaseStorage, PurchaseStorage>();
|
|
|
|
builder.Services.AddTransient<IReportLogic, ReportLogic>();
|
|
|
|
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
|
|
|
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
|
|
|
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
2023-04-07 18:59:41 +04:00
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
APIClient.Connect(builder.Configuration);
|
|
|
|
|
|
|
|
// 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 production 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();
|