complete lab 2 hard

This commit is contained in:
Viltskaa 2023-03-14 10:46:34 +04:00
parent 40a93a182a
commit a44b0f052d
4 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -47,6 +47,7 @@ namespace SushiBar
services.AddTransient<FormStores>();
services.AddTransient<FormStore>();
services.AddTransient<FormStoreReplenishment>();
services.AddTransient<FormStoreSell>();
}
}
}

View File

@ -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;

View File

@ -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))
{