public string ToCurrencyCode(string countryCode) { if (!ToCurrency.ContainsKey(countryCode)) { throw new InvalidOperationException("Invalid Code."); } return(ToCurrency[countryCode]); }
public void AddToCurrency(ToRelation relation) { var currency = _context.Currencies.Where(c => c.CurrencyId == relation.CurrencyId).FirstOrDefault(); var targetCur = new ToCurrency() { ToCurrencyId = relation.CurrencyId, ToRelation = relation, ToRelationId = relation.CurrencyRelationId, FullName = currency.FullName, IsoCode = currency.IsoCode }; _context.ToCurrencies.Add(targetCur); }
protected override void Execute(CodeActivityContext context) { strFCur = FromCurrency.Get(context); strTCur = ToCurrency.Get(context); Rate.Set(context, GetExchangeRate()); }
public override string ToString() { return($" The predicted currency exchange from {FromCurrency.ToUpper()} " + $" to {ToCurrency.ToUpper()} for {Date} is {Rate}. "); }