упрощение кода логики магазина

This commit is contained in:
Мк Игорь 2023-03-28 13:23:36 +04:00
parent 8834faa3ae
commit 5eda887cf9

View File

@ -117,13 +117,14 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
{
selectedStore.Manufactures[manufacture.Id - 1] = (manufacture, selectedStore.Manufactures[manufacture.Id - 1].Item2 + count);
SaveChanges(selectedStore);
_logger.LogInformation("Filled store Id = {storeId} with manufacture Id = {manufactureId}. Count = {count}", model.i)
_logger.LogInformation("Filled store Id = {storeId} with manufacture Id = {manufactureId}. Count = {count}", model.Id, manufacture.Id, count);
return true;
}
}
//иначе добавляем изделие в магазин в указанном количестве
selectedStore.Manufactures.Add((manufacture, count));
SaveChanges(selectedStore);
_logger.LogInformation("Added new manufacture Id = {manufactureId} in store Id = {storeId}. Count = {count}", manufacture.Id, model.Id, count);
return true;
}
private void CheckModel(StoreBindingModel model, bool withParams = true)