правочки
This commit is contained in:
parent
8b48ca32e9
commit
33bfee6b85
@ -50,18 +50,16 @@ 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();
|
||||
}
|
||||
|
||||
public List<OrderViewModel> GetFullList()
|
||||
{
|
||||
return source.Orders.Select(x => GetPackageName(x.GetViewModel)).Select(GetClientName).ToList();
|
||||
return source.Orders.Select(x => GetPackageName(x.GetViewModel)).ToList();
|
||||
}
|
||||
|
||||
public OrderViewModel? Insert(OrderBindingModel model)
|
||||
|
@ -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