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