правочка

This commit is contained in:
Максим Яковлев 2024-05-19 16:35:27 +04:00
parent 9bf1d4ed0e
commit 2e9e3f5567
2 changed files with 22 additions and 3 deletions

View File

@ -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.Неизвестен;

View File

@ -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<OrderStatus>(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<OrderStatus>(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<OrderStatus>(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)
{