Exemplo n.º 1
0
        public float?GetTotalFloat(int currency)
        {
            decimal total = Price * Quantity;

            if (currency != Currency)
            {
                try
                {
                    ConversionModel cm = new ConversionModel();
                    total = cm.Convert(total, Currency, currency);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Failed", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(null);
                }
            }
            return((float)total);
        }
Exemplo n.º 2
0
        public void SetFullAmount(int currency)
        {
            decimal amount = (decimal)Amount;

            if (currency != Currency)
            {
                try
                {
                    ConversionModel cm = new ConversionModel();
                    amount = cm.Convert((decimal)Amount, (int)Currency, currency);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Failed", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            CurrencyModel c = new CurrencyModel();

            c          = c.Get(currency);
            FullAmount = amount + " " + c.Symbol;
        }