ПИбд-23 Салин Олег Алексеевич Лабораторная работа №4 (Усложненная) #18

Closed
Oleja123 wants to merge 30 commits from Lab4_Hard into Lab4
2 changed files with 5 additions and 1 deletions
Showing only changes of commit b9dfa72660 - Show all commits

View File

@ -136,7 +136,7 @@ namespace IceCreamShopBusinessLogic.BusinessLogic
_logger.LogWarning("Status change operation failed");
throw new InvalidOperationException("Текущий статус заказа не может быть переведен в выбранный");
}
if(status == OrderStatus.Готов)
if(element.Status == OrderStatus.Готов)
{
var icecream = _iceCreamStorage.GetElement(new IceCreamSearchModel() { Id = model.IceCreamId });
if (icecream == null)

View File

@ -114,6 +114,10 @@ model.Id);
{
var min = Math.Min(icecream.Value.Item2, count);
icecreams[icecream.Value.Item1.Id] = (icecream.Value.Item1, icecream.Value.Item2 - min);
if(icecreams[icecream.Value.Item1.Id].Item2 == 0)
{
icecreams.Remove(icecream.Value.Item1.Id);
}
count -= min;
if (count <= 0)