ПИбд-21 Кувшинов Тимур сложная лаба 7 #26

Closed
TImourka wants to merge 9 commits from laba7complicated into laba6complicated
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 09ad9b86ab - Show all commits

View File

@ -23,7 +23,7 @@ namespace AutomobilePlantDatabaseImplement.Implements
{
using var context = new AutomobilePlantDatabase();
var messages = context.Messages
.Where(x => x.ClientId == model.ClientId)
.Where(x => !model.ClientId.HasValue || x.ClientId == model.ClientId)
.Select(x => x.GetViewModel)
.ToList();
if (!model.Page.HasValue || !model.PageSize.HasValue)

View File

@ -26,7 +26,7 @@ namespace AutomobilePlantFileImplement.Implements
public List<MessageInfoViewModel> GetFilteredList(MessageInfoSearchModel model)
{
var messages = _source.Messages
.Where(x => x.ClientId == model.ClientId)
.Where(x => !model.ClientId.HasValue || x.ClientId == model.ClientId)
.Select(x => x.GetViewModel)
.ToList();
if (!model.Page.HasValue || !model.PageSize.HasValue)

View File

@ -28,7 +28,7 @@ namespace AutomobilePlantListImplement.Implements
List<MessageInfoViewModel> result = new();
foreach (var item in _source.Messages)
{
if (item.ClientId.HasValue && item.ClientId == model.ClientId)
if (!model.ClientId.HasValue || item.ClientId == model.ClientId)
{
result.Add(item.GetViewModel);
}