Exemple #1
0
        public void Handle(PayedOrderRequest message)
        {
            var response = new CancelOrderResponse();
            var service  = new HotelOrderService();

            try
            {
                var order = service.GetModel(message.OrderId);
                if (CheckStatus(order))
                {
                    response.Success = service.Update(message.OrderId,
                                                      HotelStatusManager.OrderStatus.Payed.StatusId.ToString());
                }
                else
                {
                    response.Success = false;
                }
            }
            catch
            {
                response.Success = false;
            }

            _bus.Reply(response);
        }
        public void Handle(GetOrderRequest message)
        {
            var service = new HotelOrderService();
            var order   = service.GetModel(message.OrderId);

            _bus.Reply(new GetOrderResponse()
            {
                Order = order.MapTo <OrderDto>()
            });
        }