Merge branch 'hard_lab4' into hard_lab5
This commit is contained in:
commit
5398571593
@ -100,6 +100,12 @@ namespace FlowerShopBusinessLogic.BusinessLogics
|
|||||||
_logger.LogWarning("MakeSupply(GetElement). Element not found");
|
_logger.LogWarning("MakeSupply(GetElement). Element not found");
|
||||||
return false;
|
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))
|
if (shop.ShopFlowers.ContainsKey(flower.Id))
|
||||||
{
|
{
|
||||||
var shopFlower = shop.ShopFlowers[flower.Id];
|
var shopFlower = shop.ShopFlowers[flower.Id];
|
||||||
|
Loading…
Reference in New Issue
Block a user