示例#1
0
        public void Execute(Guid id)
        {
            OrderDetailsDTO orderDetailsDTO = _orderDetailsRepository.Execute(id);

            if (orderDetailsDTO is null)
            {
                return;
            }

            OrderModel orderModel = OrderModel.Factory.Load(
                orderDetailsDTO.Id,
                orderDetailsDTO.TableId,
                orderDetailsDTO.OrderNumber,
                orderDetailsDTO.Status,
                orderDetailsDTO.OpenDate,
                orderDetailsDTO.ClosingDate
                );

            if (orderModel.Status != EOrderStatus.Open)
            {
                return;
            }
            orderModel.CloseOrder();

            _closeOrderRepository.Execute(orderModel);
        }