Compare commits

...

2 Commits

Author SHA1 Message Date
c457242e5a После поправки в лаб 2 усл. 2024-05-17 14:10:29 +04:00
366a106308 Небольшая правка 2024-05-17 14:05:17 +04:00

View File

@ -150,15 +150,12 @@ namespace GarmentFactoryFileImplement.Implements
return false; return false;
} }
foreach (Shop shop in source.Shops) var shopsWithFreeSpace = source.Shops.Where(x => x.TextileMaxCount - x.ShopTextiles.Select(x => x.Value.Item2).Sum() > 0);
foreach (Shop shop in shopsWithFreeSpace)
{ {
int freeSpace = shop.TextileMaxCount - shop.ShopTextiles.Select(x => x.Value.Item2).Sum(); int freeSpace = shop.TextileMaxCount - shop.ShopTextiles.Select(x => x.Value.Item2).Sum();
if (freeSpace <= 0)
{
continue;
}
freeSpace = Math.Min(freeSpace, model.Count); freeSpace = Math.Min(freeSpace, model.Count);
model.Count -= freeSpace; model.Count -= freeSpace;