public ChangeCustomerOrderCommandHandler( ICustomerRepository customerRepository, IForeignExchange foreignExchange, ISqlConnectionFactory sqlConnectionFactory) { this._customerRepository = customerRepository; _foreignExchange = foreignExchange; _sqlConnectionFactory = sqlConnectionFactory; }
public PlaceCustomerOrderCommandHandler( ICustomerRepository customerRepository, IProductRepository productRepository, IForeignExchange foreignExchange) { this._customerRepository = customerRepository; this._productRepository = productRepository; this._foreignExchange = foreignExchange; }
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); }
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); }