public ChangeCustomerOrderCommandHandler(
     ICustomerRepository customerRepository,
     IForeignExchange foreignExchange,
     ISqlConnectionFactory sqlConnectionFactory)
 {
     this._customerRepository = customerRepository;
     _foreignExchange         = foreignExchange;
     _sqlConnectionFactory    = sqlConnectionFactory;
 }
Example #2
0
 public PlaceCustomerOrderCommandHandler(
     ICustomerRepository customerRepository,
     IProductRepository productRepository,
     IForeignExchange foreignExchange)
 {
     this._customerRepository = customerRepository;
     this._productRepository  = productRepository;
     this._foreignExchange    = foreignExchange;
 }
Example #3
0
        public BankResult Test(string currency)
        {
            BankResult       bResult         = new BankResult();
            IForeignExchange foreignExchange = Terrasoft.Core.Factories.ClassFactory.Get <IForeignExchange>();

            Interfaces.IBankResult result = foreignExchange.GetRate(currency, DateTime.Now);

            bResult.BankName     = result.BankName;
            bResult.ExchangeRate = result.ExchangeRate;
            bResult.HomeCurrency = result.HomeCurrency;
            bResult.RateDate     = result.RateDate;

            return(bResult);
        }
Example #4
0
        protected override bool InternalExecute(ProcessExecutingContext context)
        {
            IForeignExchange foreignExchange = Factories.ClassFactory.Get <IForeignExchange>();

            string currencyCode = GetShortCurrencyCode(Currency);

            IBankResult result = default;

            if (currencyCode == "MXN" && SysSettings.TryGetValue(UserConnection, "bmxToken", out object value))
            {
                string token = value.ToString();
                result = foreignExchange.GetRate(currencyCode, Date, value.ToString());
            }
            else
            {
                result = foreignExchange.GetRate(currencyCode, Date);
            }

            ExchangeRate    = result.ExchangeRate;
            ObservationDate = result.RateDate;
            BankName        = result.BankName;
            return(true);
        }