Правки Лабораторная работа 3 (усложнёнка)

This commit is contained in:
nikbel2004@outlook.com 2024-04-08 15:05:13 +04:00
parent 68a8356a6b
commit 7aa1a836ce
3 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic
}
// Пополнение магазина
public bool AddFurniture(ShopSearchModel model, IFurnitureModel furniture, int count)
public bool SupplyFurniture(ShopSearchModel model, IFurnitureModel furniture, int count)
{
if (model == null)
{
@ -229,7 +229,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic
{
if (shop.MaxCountFurnitures - shop.ShopFurnitures.Select(x => x.Value.Item2).Sum() < count)
{
if (!AddFurniture(new() { Id = shop.Id }, model, shop.MaxCountFurnitures - shop.ShopFurnitures.Select(x => x.Value.Item2).Sum()))
if (!SupplyFurniture(new() { Id = shop.Id }, model, shop.MaxCountFurnitures - shop.ShopFurnitures.Select(x => x.Value.Item2).Sum()))
{
_logger.LogWarning("AddFurnitures operation failed.");
@ -240,7 +240,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic
}
else
{
if (!AddFurniture(new() { Id = shop.Id }, model, count))
if (!SupplyFurniture(new() { Id = shop.Id }, model, count))
{
_logger.LogWarning("AddFurnitures operation failed.");

View File

@ -23,7 +23,7 @@ namespace FurnitureAssemblyContracts.BusinessLogicsContracts
bool Delete(ShopBindingModel model);
bool AddFurniture(ShopSearchModel model, IFurnitureModel furniture, int count);
bool SupplyFurniture(ShopSearchModel model, IFurnitureModel furniture, int count);
bool SellFurnitures(IFurnitureModel model, int count);

View File

@ -93,7 +93,7 @@ namespace FurnitureAssemblyView
try
{
var operationResult = _logicS.AddFurniture(new ShopSearchModel
var operationResult = _logicS.SupplyFurniture(new ShopSearchModel
{
Id = Convert.ToInt32(comboBoxShop.SelectedValue)
},