This commit is contained in:
Safgerd 2023-05-19 16:11:40 +04:00
commit 2a1d3bb6fa
3 changed files with 13 additions and 3 deletions

View File

@ -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",

View File

@ -45,6 +45,8 @@ namespace ComputerStoreDatabaseImplement.Models
Name = model.Name, Name = model.Name,
Price = model.Price, Price = model.Price,
EmployeeID = model.EmployeeID, EmployeeID = 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
}; };
@ -56,7 +58,7 @@ namespace ComputerStoreDatabaseImplement.Models
{ {
rc.PCID = model.ID; rc.PCID = model.ID;
} }
context.SaveChanges(); context.SaveChanges();
} }

View File

@ -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;
@ -36,6 +38,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);
@ -44,6 +49,9 @@ builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.Re
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(); builder.Services.AddSwaggerGen();
var app = builder.Build(); var app = builder.Build();
var mailSender = app.Services.GetService<AbstractMail>(); var mailSender = app.Services.GetService<AbstractMail>();