Лаб_2сложн
This commit is contained in:
parent
136591c7a7
commit
731cc522d8
@ -85,12 +85,14 @@ namespace RenovationWorkFileImplement.Implements
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private bool CheckSell(int RepairId, int count)
|
||||
{
|
||||
count -= _source.Shops.Select(x => x.ShopRepairs.Select(y =>
|
||||
(y.Value.Item1.Id == RepairId ? y.Value.Item2 : 0)).Sum()).Sum();
|
||||
return count <= 0;
|
||||
int availableCount = _source.Shops.Sum(x => x.ShopRepairs
|
||||
.Where(y => y.Value.Item1.Id == RepairId).Sum(y => y.Value.Item2));
|
||||
return count <= availableCount;
|
||||
}
|
||||
|
||||
public bool SellRepairs(IRepairModel model, int count)
|
||||
{
|
||||
var neededRepair = _source.Repairs.FirstOrDefault(x => x.Id == model.Id);
|
||||
|
Loading…
Reference in New Issue
Block a user