Esempio n. 1
0
        private void HandleMessage(Order order)
        {
            switch (order.OrderStatus)
            {
            case OrderStatus.Created:
            {
                _orderStatusUpdateService.UpdateStatus(order.Id, OrderStatus.InProgress, "Order created and it is in progress");
                _orderProductsUpdateMessagingSender.SendCreatedOrder(order);
                _emailMessagingSender.SendEmail(order);
                _smsMessagingSender.SendSms(order);
            }
            break;

            case OrderStatus.CancelRequested:
            {
                _orderStatusUpdateService.UpdateStatus(order.Id, OrderStatus.Cancelled, "Order is cancelled!");
                _revertProductStocksMessagingSender.UpdateStocks(order);
                _emailMessagingSender.SendEmail(order);
            }
            break;

            default:
                break;
            }
        }
 private void HandleMessage(Order order)
 {
     _smsMessagingSender.SendSms(order);
     _emailMessagingSender.SendEmail(order);
     _deliveryService.InformForDelivery(order.Id, "Email and sms is sent!");
 }