Merging with RestAPI.
This commit is contained in:
commit
55ce9512ea
@ -34,11 +34,11 @@ namespace ComputerStoreBusinessLogic.OfficePackage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach(var products in consigment.ConsignmentProducts)
|
foreach(var products in consigment.Products)
|
||||||
{
|
{
|
||||||
CreateParagraph(new WordParagraph
|
CreateParagraph(new WordParagraph
|
||||||
{
|
{
|
||||||
Texts = new List<(string, WordTextProperties)> { (products.Value.Item1.Name, new WordTextProperties { Bold = true, Size = "24", }), ($" {products.Value.Item1.Price}", new WordTextProperties { Bold = true, Size = "24", }) },
|
Texts = new List<(string, WordTextProperties)> { (products.product, new WordTextProperties { Bold = true, Size = "24", }), ($" {products.count}", new WordTextProperties { Bold = true, Size = "24", }) },
|
||||||
TextProperties = new WordTextProperties
|
TextProperties = new WordTextProperties
|
||||||
{
|
{
|
||||||
Size = "24",
|
Size = "24",
|
||||||
|
@ -46,6 +46,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
|||||||
Price = model.Price,
|
Price = model.Price,
|
||||||
EmployeeID = model.EmployeeID,
|
EmployeeID = model.EmployeeID,
|
||||||
Employee = context.Employees.First(x => x.ID == model.EmployeeID),
|
Employee = context.Employees.First(x => x.ID == model.EmployeeID),
|
||||||
|
Request = context.Requests.First(x => x.ID == model.RequestID),
|
||||||
RequestID = model.RequestID,
|
RequestID = model.RequestID,
|
||||||
PCComponents = model.PCComponents
|
PCComponents = model.PCComponents
|
||||||
};
|
};
|
||||||
@ -57,7 +58,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
rc.PCID = model.ID;
|
rc.PCID = model.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using ComputerStoreBusinessLogic.BusinessLogic;
|
using ComputerStoreBusinessLogic.BusinessLogic;
|
||||||
using ComputerStoreBusinessLogic.MailStuff;
|
using ComputerStoreBusinessLogic.MailStuff;
|
||||||
|
using ComputerStoreBusinessLogic.OfficePackage;
|
||||||
|
using ComputerStoreBusinessLogic.OfficePackage.Implements;
|
||||||
using ComputerStoreContracts.BindingModels;
|
using ComputerStoreContracts.BindingModels;
|
||||||
using ComputerStoreContracts.BusinessLogicContracts;
|
using ComputerStoreContracts.BusinessLogicContracts;
|
||||||
using ComputerStoreContracts.StorageContracts;
|
using ComputerStoreContracts.StorageContracts;
|
||||||
@ -31,6 +33,9 @@ builder.Services.AddTransient<IConsignmentLogic,ConsignmentLogic>();
|
|||||||
builder.Services.AddTransient<IRequestComponentLogic, RequestComponentLogic>();
|
builder.Services.AddTransient<IRequestComponentLogic, RequestComponentLogic>();
|
||||||
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
|
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
|
||||||
|
|
||||||
|
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
||||||
|
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
||||||
|
builder.Services.AddTransient<AbstractSaveToPDF, SaveToPDF>();
|
||||||
builder.Services.AddSingleton<AbstractMail, MailKit>();
|
builder.Services.AddSingleton<AbstractMail, MailKit>();
|
||||||
|
|
||||||
builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
||||||
@ -39,7 +44,7 @@ builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.Re
|
|||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
|
|
||||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|
||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
Loading…
Reference in New Issue
Block a user