¯\_(ツ)_/¯
This commit is contained in:
parent
a9ec52a3f7
commit
9702c9e624
@ -114,7 +114,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
|
|||||||
{
|
{
|
||||||
var document = _saveToExcel.CreateReport(new ExcelInfoClient
|
var document = _saveToExcel.CreateReport(new ExcelInfoClient
|
||||||
{
|
{
|
||||||
Title = "Список оплат",
|
Title = "Список оплат и товаров",
|
||||||
PaymeantProducts = GetPaymeantProducts(_clientID)
|
PaymeantProducts = GetPaymeantProducts(_clientID)
|
||||||
});
|
});
|
||||||
return document;
|
return document;
|
||||||
@ -123,7 +123,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
|
|||||||
public byte[]? SavePaymeantToWordFile(int _clientID)
|
public byte[]? SavePaymeantToWordFile(int _clientID)
|
||||||
{
|
{
|
||||||
var document = _saveToWord.CreateDoc(new WordInfoClient {
|
var document = _saveToWord.CreateDoc(new WordInfoClient {
|
||||||
Title = "Список оплат и товаров",
|
Title = "Список оплат",
|
||||||
ListPaymeant = _paymeantstorage.GetFillteredList(new PaymeantSearchModel { ClientID = _clientID }),
|
ListPaymeant = _paymeantstorage.GetFillteredList(new PaymeantSearchModel { ClientID = _clientID }),
|
||||||
});
|
});
|
||||||
return document;
|
return document;
|
||||||
|
@ -97,4 +97,4 @@ namespace ElectronicsShopBusinessLogic.OfficePackage
|
|||||||
// Сохранение файла
|
// Сохранение файла
|
||||||
protected abstract byte[]? SaveExcel(ExcelInfoClient info);
|
protected abstract byte[]? SaveExcel(ExcelInfoClient info);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -70,7 +70,6 @@ namespace ElectronicsShopDataBaseImplement.Implements
|
|||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
if (model.ClientID.HasValue) {
|
if (model.ClientID.HasValue) {
|
||||||
return context.Orders
|
return context.Orders
|
||||||
.Include(x => x.Payments)
|
|
||||||
.Include(x => x.Products)
|
.Include(x => x.Products)
|
||||||
.ThenInclude(x => x._product)
|
.ThenInclude(x => x._product)
|
||||||
.OrderBy(x => x.ID)
|
.OrderBy(x => x.ID)
|
||||||
@ -79,7 +78,6 @@ namespace ElectronicsShopDataBaseImplement.Implements
|
|||||||
if (model.ID.HasValue)
|
if (model.ID.HasValue)
|
||||||
{
|
{
|
||||||
return context.Orders
|
return context.Orders
|
||||||
.Include(x => x.Payments)
|
|
||||||
.Include(x => x.Products)
|
.Include(x => x.Products)
|
||||||
.ThenInclude(x => x._product)
|
.ThenInclude(x => x._product)
|
||||||
.FirstOrDefault(x => (model.ID.HasValue && x.ID == model.ID))?.GetViewModel;
|
.FirstOrDefault(x => (model.ID.HasValue && x.ID == model.ID))?.GetViewModel;
|
||||||
|
@ -46,9 +46,6 @@ namespace ElectronicsShopDataBaseImplement.Models
|
|||||||
[ForeignKey("OrderID")]
|
[ForeignKey("OrderID")]
|
||||||
public virtual List<OrderProduct> Products { get; set; } = new();
|
public virtual List<OrderProduct> Products { get; set; } = new();
|
||||||
|
|
||||||
[ForeignKey("PaymentID")]
|
|
||||||
public virtual List<Paymeant> Payments { get; set; } = new();
|
|
||||||
|
|
||||||
public static Order? Create(Database context ,OrderBindingModel? model)
|
public static Order? Create(Database context ,OrderBindingModel? model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user