diff --git a/CarRepairShop/CarRepairShopContracts/BindingModels/OrderBindingModel.cs b/CarRepairShop/CarRepairShopContracts/BindingModels/OrderBindingModel.cs index 314d4ab..e8d90dc 100644 --- a/CarRepairShop/CarRepairShopContracts/BindingModels/OrderBindingModel.cs +++ b/CarRepairShop/CarRepairShopContracts/BindingModels/OrderBindingModel.cs @@ -12,6 +12,7 @@ namespace CarRepairShopContracts.BindingModels { public int Id { get; set; } public int RepairId { get; set; } + public int Count { get; set; } public double Sum { get; set; } public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; diff --git a/CarRepairShop/CarRepairShopView/FormMain.cs b/CarRepairShop/CarRepairShopView/FormMain.cs index f2c829a..793a7b5 100644 --- a/CarRepairShop/CarRepairShopView/FormMain.cs +++ b/CarRepairShop/CarRepairShopView/FormMain.cs @@ -77,9 +77,15 @@ namespace CarRepairShopView _logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id); try { - var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { + var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel + { Id = id, + RepairId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["RepairId"].Value), + RepairName = dataGridView.SelectedRows[0].Cells["RepairName"].Value.ToString(), Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) { @@ -103,9 +109,15 @@ namespace CarRepairShopView _logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", id); try { - var operationResult = _orderLogic.FinishOrder(new OrderBindingModel { + var operationResult = _orderLogic.FinishOrder(new OrderBindingModel + { Id = id, + RepairId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["RepairId"].Value), + RepairName = dataGridView.SelectedRows[0].Cells["RepairName"].Value.ToString(), Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) { @@ -129,9 +141,15 @@ namespace CarRepairShopView _logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id); try { - var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { + var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel + { Id = id, + RepairId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["RepairId"].Value), + RepairName = dataGridView.SelectedRows[0].Cells["RepairName"].Value.ToString(), Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) {