This commit is contained in:
Alenka 2024-06-17 13:01:15 +04:00
parent 9c1e439686
commit c8284d0a19

View File

@ -123,11 +123,20 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
});
if (Jewel == null)
{
throw new ArgumentException($"Поставка: Товар с id:{model.JewelId} не найденн");
throw new ArgumentException($"Поставка: Товар с id:{model.JewelId} не найден");
}
shop.Jewels.Add(model.JewelId, (Jewel, model.Count));
}
return true;
_shopStorage.Update(new StoreBindingModel()
{
Id = shop.Id,
StoreName = shop.StoreName,
StoreAdress = shop.StoreAdress,
OpeningDate = shop.OpeningDate,
Jewels = shop.Jewels,
JewelMaxCount = shop.JewelMaxCount,
});
return true;
}
private void CheckModel(StoreBindingModel model, bool withParams = true)