PIbd-22. Fedorenko G.Y. Lab Work 1 HARD #2
@ -100,36 +100,5 @@ namespace CarpentryWorkshopListImplement.Implements
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* public bool SupplyWood(ShopSearchModel model, IWoodModel wood, int count)
|
||||
{
|
||||
if (model == null)
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
if (wood == null)
|
||||
throw new ArgumentNullException(nameof(wood));
|
||||
if (count <= 0)
|
||||
throw new ArgumentNullException("Количество должно быть положительным числом");
|
||||
|
||||
ShopViewModel curModel = GetElement(model);
|
||||
if (curModel == null)
|
||||
throw new ArgumentNullException(nameof(curModel));
|
||||
if (curModel.ShopWoods.TryGetValue(wood.Id, out var pair))
|
||||
{
|
||||
curModel.ShopWoods[wood.Id] = (pair.Item1, pair.Item2 + count);
|
||||
}
|
||||
else
|
||||
{
|
||||
curModel.ShopWoods.Add(wood.Id, (wood, count));
|
||||
}
|
||||
Update(new()
|
||||
{
|
||||
Id = curModel.Id,
|
||||
ShopName = curModel.ShopName,
|
||||
DateOpen = curModel.DateOpen,
|
||||
Address = curModel.Address,
|
||||
ShopWoods = curModel.ShopWoods,
|
||||
});
|
||||
return true;
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user