fix
This commit is contained in:
parent
eadf7da836
commit
85dd33db61
@ -13,7 +13,6 @@ namespace PrecastConcretePlantContracts.StoragesContract
|
||||
ShopViewModel? Insert(ShopBindingModel model);
|
||||
ShopViewModel? Update(ShopBindingModel model);
|
||||
ShopViewModel? Delete(ShopBindingModel model);
|
||||
bool HasNeedReinforceds(IReinforcedModel reinforced, int needCount);
|
||||
public bool SellReinforceds(IReinforcedModel reinforced, int needCount);
|
||||
}
|
||||
}
|
||||
|
@ -79,18 +79,13 @@ namespace PrecastConcretePlantFileImplement
|
||||
return shop.GetViewModel;
|
||||
}
|
||||
|
||||
public bool HasNeedReinforceds(IReinforcedModel reinforced, int needCount)
|
||||
public bool SellReinforceds(IReinforcedModel reinforced, int needCount)
|
||||
{
|
||||
var resultCount = _source.Shops
|
||||
.Select(shop => shop.Reinforceds
|
||||
.FirstOrDefault(x => x.Key == reinforced.Id).Value.Item2)
|
||||
.Sum();
|
||||
return resultCount >= needCount;
|
||||
}
|
||||
|
||||
public bool SellReinforceds(IReinforcedModel reinforced, int needCount)
|
||||
{
|
||||
if (!HasNeedReinforceds(reinforced, needCount))
|
||||
if (resultCount >= needCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -106,7 +101,6 @@ namespace PrecastConcretePlantFileImplement
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -105,11 +105,6 @@ namespace PrecastConcretePlantListImplement
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool HasNeedReinforceds(IReinforcedModel reinforced, int needCount)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool SellReinforceds(IReinforcedModel reinforced, int needCount)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Loading…
Reference in New Issue
Block a user