+данные заказа в пдф, но оказалось у меня еще много ошибок поэтому работаем
This commit is contained in:
parent
aec779bd99
commit
49438bd93a
@ -23,8 +23,11 @@ namespace ConfectioneryDatabaseImplement.Implements
|
|||||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new ConfectioneryDatabase();
|
using var context = new ConfectioneryDatabase();
|
||||||
var result = context.Orders.Include(x => x.Pastry).Select(x => x.GetViewModel).ToList();
|
if (model.DateFrom.HasValue)
|
||||||
return result;
|
{
|
||||||
|
return context.Orders.Include(x => x.Pastry).Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
return context.Orders.Include(x => x.Pastry).Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
|
Loading…
Reference in New Issue
Block a user