This commit is contained in:
Danil Markov 2023-05-02 14:47:19 +04:00
commit 55ed8f3c12
2 changed files with 3 additions and 4 deletions

View File

@ -115,8 +115,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
} }
if (count <= 0) if (count <= 0)
{ {
return false; throw new ArgumentException("Количество документов должно быть больше 0", nameof(count));
throw new ArgumentException("Количество поездок должно быть больше 0", nameof(count));
} }
_logger.LogInformation("AddDocument. ShopName:{ShopName}. Id:{Id}", model.ShopName, model.Id); _logger.LogInformation("AddDocument. ShopName:{ShopName}. Id:{Id}", model.ShopName, model.Id);
var element = _shopStorage.GetElement(model); var element = _shopStorage.GetElement(model);

View File

@ -45,12 +45,12 @@ namespace LawFirmView
try try
{ {
int id = Convert.ToInt32(comboBoxDocument.SelectedValue); int id = Convert.ToInt32(comboBoxDocument.SelectedValue);
var product = _logicD.ReadElement(new DocumentSearchModel var document = _logicD.ReadElement(new DocumentSearchModel
{ {
Id = id Id = id
}); });
int count = Convert.ToInt32(textBoxCount.Text); int count = Convert.ToInt32(textBoxCount.Text);
textBoxSum.Text = Math.Round(count * (product?.Price ?? 0), 2).ToString(); textBoxSum.Text = Math.Round(count * (document?.Price ?? 0), 2).ToString();
_logger.LogInformation("Расчет суммы заказа"); _logger.LogInformation("Расчет суммы заказа");
} }
catch (Exception ex) catch (Exception ex)