Lab4_Hard in Lab5_Hard #11

Closed
goldfest228 wants to merge 8 commits from Lab4_Hard into Lab5_Hard
Showing only changes of commit 0e64524320 - Show all commits

View File

@ -123,6 +123,10 @@ namespace TravelCompanyBusinessLogic.BusinessLogics
{
throw new ArgumentException($"Поставка: Товар с id:{model.TravelId} не найденн");
}
if (shop.ShopTravels.Sum(kv => kv.Value.Item2) + model.Count > shop.TravelMaxCount)
{
throw new ArgumentException("Превышена максимальная вместимость магазина");
}
shop.ShopTravels.Add(model.TravelId, (Travel, model.Count));
}
@ -139,6 +143,7 @@ namespace TravelCompanyBusinessLogic.BusinessLogics
return true;
}
private void CheckModel(ShopBindingModel model, bool withParams = true)
{
if (model == null)