исправил ошибки из PR
This commit is contained in:
parent
841c125119
commit
59f3b26fe2
@ -30,29 +30,6 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics
|
||||
}
|
||||
public List<ReportPackageComponentViewModel> GetPackageComponent()
|
||||
{
|
||||
/*var components = _componentStorage.GetFullList();
|
||||
var packages = _packageStorage.GetFullList();
|
||||
var list = new List<ReportPackageComponentViewModel>();
|
||||
foreach (var package in packages)
|
||||
{
|
||||
var record = new ReportPackageComponentViewModel
|
||||
{
|
||||
PackageName = package.PackageName,
|
||||
Components = new List<Tuple<string, int>>(),
|
||||
TotalCount = 0
|
||||
};
|
||||
foreach (var package in packages)
|
||||
{
|
||||
if (package.PackageComponents.ContainsKey(component.Id))
|
||||
{
|
||||
record.Packages.Add(new Tuple<string, int>(package.PackageName, package.PackageComponents[component.Id].Item2));
|
||||
record.TotalCount += package.PackageComponents[component.Id].Item2;
|
||||
}
|
||||
}
|
||||
list.Add(record);
|
||||
}
|
||||
return list;*/
|
||||
|
||||
return _packageStorage.GetFullList().Select(x => new ReportPackageComponentViewModel
|
||||
{
|
||||
PackageName = x.PackageName,
|
||||
|
@ -47,12 +47,14 @@ namespace SoftwareInstallationFileImplement.Implements
|
||||
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
return source.Orders.Where(x => x.Id == model.Id).Select(x => GetPackageName(x.GetViewModel)).ToList();
|
||||
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)
|
||||
)
|
||||
)
|
||||
.Select(x => GetPackageName(x.GetViewModel))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<OrderViewModel> GetFullList()
|
||||
|
@ -71,15 +71,18 @@ namespace SoftwareInstallationListImplement.Implements
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<OrderViewModel> GetFullList()
|
||||
public List<OrderViewModel> GetFullList(OrderSearchModel model)
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
result.Add(GetViewModelName(order));
|
||||
if ((!model.Id.HasValue || order.Id == model.Id) &&
|
||||
(!model.DateFrom.HasValue || order.DateCreate >= model.DateFrom) &&
|
||||
(!model.DateTo.HasValue || order.DateCreate <= model.DateTo))
|
||||
{
|
||||
result.Add(GetViewModelName(order.GetViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user