Compare commits
2 Commits
8b48ca32e9
...
ff03c8225c
Author | SHA1 | Date | |
---|---|---|---|
ff03c8225c | |||
33bfee6b85 |
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user