фиг знает

This commit is contained in:
bekodeg
2024-04-29 21:02:41 +04:00
parent 210d90bb69
commit 493886c45a
9 changed files with 82 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ using ComputerHardwareStoreContracts.BusinessLogicsContracts;
using ComputerHardwareStoreContracts.SearchModels;
using ComputerHardwareStoreContracts.StorageContracts;
using ComputerHardwareStoreContracts.ViewModels;
using ComputerHardwareStoreDataModels.Enums;
using Microsoft.Extensions.Logging;
namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
@@ -78,7 +79,6 @@ namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
model.OrderProduct = element.OrderProduct;
model.DateCreate = element.DateCreate;
model.Status = element.Status;
model.Cost = element.Cost;
if (model.Status != orderStatus - 1)
{
@@ -106,9 +106,9 @@ namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
{
return;
}
if (model.Cost <= 0)
if (model.Sum <= 0)
{
throw new ArgumentNullException("Цена заказа должна быть больше 0", nameof(model.Cost));
throw new ArgumentNullException("Цена заказа должна быть больше 0", nameof(model.Sum));
}
}
}

View File

@@ -92,7 +92,7 @@ namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
{
return;
}
if (string.IsNullOrEmpty(model.DateCreate))
if (model.DateCreate == null) // TODO чего блин, всмысле нет
{
throw new ArgumentNullException("Нет даты создания покупки", nameof(model.Date));
}