ПИбд-23 Салин Олег Алексеевич Лабораторная работа №4 (Усложненная) #18
@ -67,15 +67,11 @@ namespace IceCreamShopBusinessLogic.BusinessLogic
|
||||
return false;
|
||||
}
|
||||
|
||||
int freeSpace = 0;
|
||||
foreach (var shop in _shopStorage.GetFullList())
|
||||
{
|
||||
freeSpace += shop.MaxCapacity;
|
||||
foreach (var doc in shop.ShopIceCreams)
|
||||
{
|
||||
freeSpace -= doc.Value.Item2;
|
||||
}
|
||||
}
|
||||
int sumCapacity = 0;
|
||||
int sumCount = 0;
|
||||
sumCapacity = _shopStorage.GetFullList().Select(x => x.MaxCapacity).Sum();
|
||||
sumCount = _shopStorage.GetFullList().Select(x => x.ShopIceCreams.Select(y => y.Value.Item2).Sum()).Sum();
|
||||
int freeSpace = sumCapacity - sumCount;
|
||||
|
||||
if (freeSpace - count < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user