Merge branch 'Lab5_Base' into Lab5_Hard

This commit is contained in:
Данияр Аглиуллов 2023-03-05 12:28:30 +04:00
commit 5dc3f27e90

View File

@ -92,14 +92,21 @@ namespace ConfectioneryView
MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
if (comboBoxClient.SelectedValue == null)
{
MessageBox.Show("Выберите клиента", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_logger.LogInformation("Создание заказа"); _logger.LogInformation("Создание заказа");
try try
{ {
var operationResult = _logicO.CreateOrder(new OrderBindingModel var operationResult = _logicO.CreateOrder(new OrderBindingModel
{ {
ClientId = Convert.ToInt32(comboBoxClient.SelectedValue),
PastryId = Convert.ToInt32(comboBoxPastry.SelectedValue), PastryId = Convert.ToInt32(comboBoxPastry.SelectedValue),
Count = Convert.ToInt32(textBoxCount.Text), Count = Convert.ToInt32(textBoxCount.Text),
Sum = Convert.ToDouble(textBoxSum.Text) Sum = Convert.ToDouble(textBoxSum.Text),
}); });
if (!operationResult) if (!operationResult)
{ {