PIbd-21. Makarov D.V. Lab work 04. Hard #13

Closed
DavidMakarov wants to merge 11 commits from hard_lab4 into hard_lab3
Showing only changes of commit 3b49ff7995 - Show all commits

View File

@ -100,6 +100,12 @@ namespace FlowerShopBusinessLogic.BusinessLogics
_logger.LogWarning("MakeSupply(GetElement). Element not found");
return false;
}
int CurrentRepairsNum = shop.ShopFlowers.Select(x => x.Value.Item2).Sum();
if (count > (shop.MaximumFlowers - CurrentRepairsNum))
{
_logger.LogWarning("Попытка добавить в магазин число элементов, большее RepairsMaxCount");
return false;
}
if (shop.ShopFlowers.ContainsKey(flower.Id))
{
var shopFlower = shop.ShopFlowers[flower.Id];