diff --git a/AutomobilePlant/AutomobilePlantDatabaseImplement/Implements/MessageInfoStorage.cs b/AutomobilePlant/AutomobilePlantDatabaseImplement/Implements/MessageInfoStorage.cs index 92f3b92..e4dbd89 100644 --- a/AutomobilePlant/AutomobilePlantDatabaseImplement/Implements/MessageInfoStorage.cs +++ b/AutomobilePlant/AutomobilePlantDatabaseImplement/Implements/MessageInfoStorage.cs @@ -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) diff --git a/AutomobilePlant/AutomobilePlantFileImplement/Implements/MessageInfoStorage.cs b/AutomobilePlant/AutomobilePlantFileImplement/Implements/MessageInfoStorage.cs index f852696..b6a46eb 100644 --- a/AutomobilePlant/AutomobilePlantFileImplement/Implements/MessageInfoStorage.cs +++ b/AutomobilePlant/AutomobilePlantFileImplement/Implements/MessageInfoStorage.cs @@ -26,7 +26,7 @@ namespace AutomobilePlantFileImplement.Implements public List 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) diff --git a/AutomobilePlant/AutomobilePlantListImplement/Implements/MessageInfoStorage.cs b/AutomobilePlant/AutomobilePlantListImplement/Implements/MessageInfoStorage.cs index bddb30f..7df915f 100644 --- a/AutomobilePlant/AutomobilePlantListImplement/Implements/MessageInfoStorage.cs +++ b/AutomobilePlant/AutomobilePlantListImplement/Implements/MessageInfoStorage.cs @@ -28,7 +28,7 @@ namespace AutomobilePlantListImplement.Implements List 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); }