Правки Лабораторная работа 3 (усложнёнка)
This commit is contained in:
parent
68a8356a6b
commit
7aa1a836ce
@ -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.");
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -93,7 +93,7 @@ namespace FurnitureAssemblyView
|
||||
|
||||
try
|
||||
{
|
||||
var operationResult = _logicS.AddFurniture(new ShopSearchModel
|
||||
var operationResult = _logicS.SupplyFurniture(new ShopSearchModel
|
||||
{
|
||||
Id = Convert.ToInt32(comboBoxShop.SelectedValue)
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user