Быстрая поправка

This commit is contained in:
ujijrujijr 2024-05-01 20:54:46 +04:00
parent 6b9da32038
commit 3f62f0b923
2 changed files with 6 additions and 7 deletions

View File

@ -14,10 +14,7 @@ namespace ComputerShopContracts.ViewModels
public double OrderSum { get; set; }
public OrderStatus OrderStatus { get; set; }
//данные заявок
public List<(int RequestId, string ClientFIO, DateTime DateRequest)> Requests { get; set; }
//данные сборок
public List<(string AssemblyName, string AssemblyCategory, double AssemblyPrice)> Assemblies { get; set; }
//данные заявок и сборок
public List<(int RequestId, string ClientFIO, DateTime DateRequest, string AssemblyName, string AssemblyCategory, double AssemblyPrice)> RequestsAssemblies { get; set; }
}
}

View File

@ -90,8 +90,10 @@ namespace ComputerShopDatabaseImplement.Implements
DateCreateOrder = x.DateCreate,
OrderSum = x.Sum,
OrderStatus = x.Status,
Requests = x.Requests.Select(r => (r.Request.Id, r.Request.ClientFIO, r.Request.DateRequest)).ToList(),
Assemblies = x.Requests.Select(r => (r.Request.Assembly.AssemblyName, r.Request.Assembly.Category, r.Request.Assembly.Price)).ToList(),
RequestsAssemblies = x.Requests.Select(r => (r.Request.Id, r.Request.ClientFIO, r.Request.DateRequest,
(r.Request.Assembly != null) ? r.Request.Assembly.AssemblyName : "Без сборки",
(r.Request.Assembly != null) ? r.Request.Assembly.Category : "Без сборки",
(r.Request.Assembly != null) ? r.Request.Assembly.Price : 0)).ToList()
})
.ToList();
}