Example #1
0
        public string ToCurrencyCode(string countryCode)
        {
            if (!ToCurrency.ContainsKey(countryCode))
            {
                throw new InvalidOperationException("Invalid Code.");
            }

            return(ToCurrency[countryCode]);
        }
Example #2
0
        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);
        }
Example #3
0
 protected override void Execute(CodeActivityContext context)
 {
     strFCur = FromCurrency.Get(context);
     strTCur = ToCurrency.Get(context);
     Rate.Set(context, GetExchangeRate());
 }
Example #4
0
 public override string ToString()
 {
     return($" The predicted currency exchange from {FromCurrency.ToUpper()} "
            + $" to {ToCurrency.ToUpper()} for {Date} is {Rate}. ");
 }