示例#1
0
 public Price GetPrice(IRateExchange exchange, IUserContext userContext)
 {
     User currentUser = userContext.GetCurrentUser();
     Currency currency = userContext.GetSelectedCurrency(currentUser);
     int priceInSelectedCurrency = exchange.Convert(GetPrice(), currency);
     var price = new Price{Currency = currency, Value = priceInSelectedCurrency};
     return price;
 }
        public OrderProcessorServiceLocator(IUserContext userContext, IRateExchange rateExchange, IAccountsReceivable accountsReceivable)
        {
            _userContext        = userContext;
            _rateExchange       = rateExchange;
            _accountsReceivable = accountsReceivable;

            InstanceId = Guid.NewGuid();
        }
示例#3
0
        public OrderProcessorContainer(IWindsorContainer container, IUserContext userContext, IRateExchange rateExchange, IAccountsReceivable accountsReceivable)
        {
            _userContext        = userContext;
            _rateExchange       = rateExchange;
            _accountsReceivable = accountsReceivable;

            _container = container;
            InstanceId = Guid.NewGuid();
        }
 public OrderProcessor(IOrderValidator validator,
                       IAccountsReceivable receivable,
                       IRateExchange exchange, IUserContext userContext)
 {
     _validator = validator;
     _receivable = receivable;
     _exchange = exchange;
     _userContext = userContext;
 }
示例#5
0
        public Price GetPrice(IRateExchange exchange, IUserContext userContext)
        {
            User     currentUser             = userContext.GetCurrentUser();
            Currency currency                = userContext.GetSelectedCurrency(currentUser);
            int      priceInSelectedCurrency = exchange.Convert(GetPrice(), currency);
            var      price = new Price {
                Currency = currency, Value = priceInSelectedCurrency
            };

            return(price);
        }
示例#6
0
        public OrderProcessor(IOrderValidator validator,
                              IAccountsReceivable receivable,
                              IRateExchange exchange,
                              IUserContext userContext,
                              ILogger logger,
                              IOrderShipper orderShipper,
                              MessageDispatcher messageDispatcher)
        {
            Thread.Sleep(TimeSpan.FromMilliseconds(1500));
            InstanceId = Guid.NewGuid();

            _validator         = validator;
            _receivable        = receivable;
            _exchange          = exchange;
            _userContext       = userContext;
            _logger            = logger;
            _orderShipper      = orderShipper;
            _messageDispatcher = messageDispatcher;
        }
示例#7
0
 public OrderCollector(IAccountsReceivable receivable, IRateExchange exchange, IUserContext userContext)
 {
     _receivable  = receivable;
     _exchange    = exchange;
     _userContext = userContext;
 }