поиск компонентов и покупок по юзерам
This commit is contained in:
parent
0721ac8f89
commit
bcd8b8f156
@ -24,7 +24,8 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements
|
|||||||
}
|
}
|
||||||
using var context = new ComputerHardwareStoreDBContext();
|
using var context = new ComputerHardwareStoreDBContext();
|
||||||
return context.Components
|
return context.Components
|
||||||
.Where(c => c.Name.Contains(model.Name))
|
.Where(c => c.Name.Contains(model.Name) ||
|
||||||
|
(c.StoreKeeper.Id == model.StoreKeeperId))
|
||||||
.Select(c => c.GetViewModel)
|
.Select(c => c.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements
|
|||||||
.Include(p => p.Products)
|
.Include(p => p.Products)
|
||||||
.ThenInclude(p => p.Product)
|
.ThenInclude(p => p.Product)
|
||||||
.Where(p =>
|
.Where(p =>
|
||||||
|
(model.VendorId.HasValue && model.VendorId == p.VendorId) ||
|
||||||
(model.Id.HasValue && p.Id == model.Id) ||
|
(model.Id.HasValue && p.Id == model.Id) ||
|
||||||
((model.DateFrom.HasValue && model.DateTo.HasValue) &&
|
((model.DateFrom.HasValue && model.DateTo.HasValue) &&
|
||||||
((model.DateFrom <= p.DateCreate && p.DateCreate <= model.DateTo) ||
|
((model.DateFrom <= p.DateCreate && p.DateCreate <= model.DateTo) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user