public decimal getExchangeRate(Currency targetCurrency)
        {
            CurrencyData curdat = new CurrencyData();

            if (targetCurrency.name == "usd")
            {
                return(curdat.GetRateCurrency("usd"));
            }
            else if (targetCurrency.name == "hkd")
            {
                return(curdat.GetRateCurrency("hkd"));
            }
            else
            {
                List <Currency> list = curdat.GetCurrencyRateList();
                decimal         rate = 0;

                foreach (Currency currency in list)
                {
                    if (targetCurrency.name == currency.name)
                    {
                        rate = curdat.GetRateCurrency(currency.name);
                        break;
                    }
                }

                return(rate);
            }
        }
        //private Currency currency;

        public decimal getExchangedAmount(Currency targetCurrency)
        {
            CurrencyData curdat = new CurrencyData();

            if (targetCurrency.name.ToLower() == "usd")
            {
                return(targetCurrency.amount / curdat.GetRateCurrency("usd"));
            }
            else if (targetCurrency.name.ToLower() == "hkd")
            {
                return(targetCurrency.amount / curdat.GetRateCurrency("hkd"));
            }
            else
            {
                List <Currency> list = curdat.GetCurrencyRateList();
                decimal         rate = 0;

                foreach (Currency currency in list)
                {
                    if (targetCurrency.name == currency.name)
                    {
                        rate = curdat.GetRateCurrency(currency.name);
                        break;
                    }
                }

                if (rate > 0)
                {
                    return(targetCurrency.amount / rate);
                }
                else
                {
                    return(0);
                }
            }
        }