Compare commits

..

No commits in common. "c457242e5a1f3cbf0994d377800e65f23848125f" and "60c793c1abb52e9a5a3623bf0f25fcce185e5999" have entirely different histories.

View File

@ -150,12 +150,15 @@ namespace GarmentFactoryFileImplement.Implements
return false; return false;
} }
var shopsWithFreeSpace = source.Shops.Where(x => x.TextileMaxCount - x.ShopTextiles.Select(x => x.Value.Item2).Sum() > 0); foreach (Shop shop in source.Shops)
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;