Штуки
This commit is contained in:
parent
586c0905ed
commit
50c0cdc17e
@ -13,7 +13,6 @@ namespace SushiBarContracts.StoragesContracts
|
||||
SushiViewModel? Insert(SushiBindingModel model);
|
||||
SushiViewModel? Update(SushiBindingModel model);
|
||||
SushiViewModel? Delete(SushiBindingModel model);
|
||||
bool HasSushi(ISushiModel model, int needCount);
|
||||
bool SellSushi(ISushiModel model, int count);
|
||||
}
|
||||
}
|
||||
|
@ -72,17 +72,13 @@ namespace SushiBarFileImplement.Implements
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public bool HasSushi(ISushiModel sushi, int needCount)
|
||||
{
|
||||
var temp = source.Shops
|
||||
.Select(x => x.ListSushi
|
||||
.FirstOrDefault(x => x.Key == sushi.Id).Value.Item2).Sum();
|
||||
return temp >= needCount;
|
||||
}
|
||||
|
||||
public bool SellSushi(ISushiModel model, int count)
|
||||
{
|
||||
if (!HasSushi(model, count))
|
||||
var temp = source.Shops
|
||||
.Select(x => x.ListSushi
|
||||
.FirstOrDefault(x => x.Key == model.Id).Value.Item2).Sum();
|
||||
if (temp < count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -100,11 +100,6 @@ namespace SushiBarListImplement.Implements
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool HasSushi(ISushiModel model, int needCount)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool SellSushi(ISushiModel model, int count)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Loading…
Reference in New Issue
Block a user