complete lab 2 hard
This commit is contained in:
parent
40a93a182a
commit
a44b0f052d
@ -68,7 +68,7 @@ namespace SushiBar
|
||||
{
|
||||
var list = _logicSushi.ReadList(null);
|
||||
if (list == null) return;
|
||||
SushiNames.DisplayMember = "DocumentName";
|
||||
SushiNames.DisplayMember = "SushiName";
|
||||
SushiNames.ValueMember = "Id";
|
||||
SushiNames.DataSource = list;
|
||||
SushiNames.SelectedItem = null;
|
||||
|
@ -47,6 +47,7 @@ namespace SushiBar
|
||||
services.AddTransient<FormStores>();
|
||||
services.AddTransient<FormStore>();
|
||||
services.AddTransient<FormStoreReplenishment>();
|
||||
services.AddTransient<FormStoreSell>();
|
||||
}
|
||||
}
|
||||
}
|
@ -91,7 +91,7 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
_logger.LogWarning("Status update to " + status + " operation failed. Document not found.");
|
||||
return false;
|
||||
}
|
||||
if (_storeLogic.CheckToSupply(sushi, model.Count) == false)
|
||||
if (!_storeLogic.CheckToSupply(sushi, model.Count))
|
||||
{
|
||||
_logger.LogWarning("Status update to " + status + " operation failed. Shop supply error.");
|
||||
return false;
|
||||
|
@ -110,7 +110,7 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
|
||||
_logger.LogInformation("Shop element found. ID: {0}, Name: {1}", store.Id, store.StoreName);
|
||||
int countSushi = store.Sushis.Sum(s => s.Value.Item2);
|
||||
if (store.maxSushi + countSushi >= quantity)
|
||||
if (store.maxSushi - countSushi >= quantity)
|
||||
{
|
||||
if (store.Sushis.TryGetValue(sushi.Id, out var pair))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user