Compare commits
No commits in common. "18de1f01498e593b6ff07201dfec39a39a43be75" and "242d9ab7719f6dd16f73abbf8dcf1f6f384bf79d" have entirely different histories.
18de1f0149
...
242d9ab771
@ -177,9 +177,9 @@ namespace FlowerShopBusinessLogic.BusinessLogics
|
||||
foreach (var shop in _shopStorage.GetFullList())
|
||||
{
|
||||
freeSpace += shop.MaxCountBouquets;
|
||||
foreach (var bouq in shop.ShopBouquets)
|
||||
foreach (var doc in shop.ShopBouquets)
|
||||
{
|
||||
freeSpace -= bouq.Value.Item2;
|
||||
freeSpace -= doc.Value.Item2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace FlowerShopBusinessLogic.BusinessLogics
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SellBouquet(IBouquetModel bouquet, int count)
|
||||
private bool SellBouquet(IBouquetModel bouquet, int count)
|
||||
{
|
||||
return _shopStorage.SellBouquet(bouquet, count);
|
||||
}
|
||||
@ -183,7 +183,7 @@ namespace FlowerShopBusinessLogic.BusinessLogics
|
||||
|
||||
if (model.MaxCountBouquets < 0)
|
||||
{
|
||||
throw new InvalidOperationException("Магазин с отрицательным числом максимального количества букетов!");
|
||||
throw new InvalidOperationException("Магазин с отрицательным числом максимального количества букетов!")
|
||||
}
|
||||
|
||||
_logger.LogInformation("Shop. Name: {0}, Address: {1}, ID: {2}", model.Name, model.Address, model.Id);
|
||||
|
@ -3,7 +3,6 @@ using FlowerShopContracts.SearchModels;
|
||||
using FlowerShopContracts.StoragesContracts;
|
||||
using FlowerShopContracts.ViewModels;
|
||||
using FlowerShopDataModels.Models;
|
||||
using FlowerShopFileImplement.Models;
|
||||
|
||||
namespace FlowerShopFileImplement.Implements
|
||||
{
|
||||
@ -126,7 +125,7 @@ namespace FlowerShopFileImplement.Implements
|
||||
foreach (var bouq in bouquets.Where(x => x.Value.Item1.Id == bouquet.Id))
|
||||
{
|
||||
var min = Math.Min(bouq.Value.Item2, count);
|
||||
bouquets[bouq.Value.Item1.Id] = (bouq.Value.Item1, bouq.Value.Item2 - min);
|
||||
bouquets[bouq.Value.Item1.Id] = (bouq.Value.Item1, doc.Value.Item2 - min);
|
||||
count -= min;
|
||||
|
||||
if (count <= 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user