Compare commits

..

2 Commits

Author SHA1 Message Date
ff03c8225c 5 работает!!! 2024-05-04 15:51:46 +04:00
33bfee6b85 правочки 2024-05-04 15:51:46 +04:00
2 changed files with 11 additions and 12 deletions

View File

@ -50,12 +50,10 @@ namespace SoftwareInstallationFileImplement.Implements
return source.Orders.Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) &&
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo) &&
(!model.ClientId.HasValue || x.ClientId == model.ClientId)
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo)
)
)
.Select(x => GetPackageName(x.GetViewModel))
.Select(GetClientName)
.ToList();
}

View File

@ -54,14 +54,15 @@ namespace SoftwareInstallationListImplement.Implements
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{
var result = new List<OrderViewModel>();
foreach (var order in _source.Orders)
{
if ((!model.Id.HasValue || order.Id == model.Id) &&
(!model.DateFrom.HasValue || order.DateCreate >= model.DateFrom) &&
(!model.DateTo.HasValue || order.DateCreate <= model.DateTo) &&
(!model.ClientId.HasValue || order.ClientId == model.ClientId)) ;
(!model.DateFrom.HasValue || order.DateCreate >= model.DateFrom)
&& (!model.DateTo.HasValue || order.DateCreate <= model.DateTo))
{
result.Add(GetClientName(GetViewModelName(order.GetViewModel)));
result.Add(GetViewModelName(order.GetViewModel));
}
}
return result;
@ -72,7 +73,7 @@ namespace SoftwareInstallationListImplement.Implements
var result = new List<OrderViewModel>();
foreach (var order in _source.Orders)
{
result.Add(GetClientName(GetViewModelName(order.GetViewModel)));
result.Add(GetViewModelName(order.GetViewModel));
}
return result;
}
@ -114,17 +115,17 @@ namespace SoftwareInstallationListImplement.Implements
return null;
}
private OrderViewModel GetViewModelName(OrderViewModel viewModel)
private OrderViewModel GetViewModelName(OrderViewModel model)
{
foreach (var package in _source.Packages)
{
if (package.Id == viewModel.PackageId)
if (package.Id == model.PackageId)
{
viewModel.PackageName = package.PackageName;
model.PackageName = package.PackageName;
break;
}
}
return viewModel;
return model;
}
private OrderViewModel GetClientName(OrderViewModel viewModel)