Exemplo n.º 1
0
        private void ConvertCurrency()
        {
            var cf = (CashFlow)View.CurrentObject;

            if (cf.Account == null)
            {
                throw new UserFriendlyException("Account must be specified");
            }

            var functionalCurrency = ObjectSpace.GetObjectByKey <Currency>(SetOfBooks.CachedInstance.FunctionalCurrency.Oid);

            var rateObj = ForexRate.GetForexRateObject(cf.Account.Currency, functionalCurrency, (DateTime)cf.TranDate);

            string message = string.Format("rate = {0}", rateObj.ConversionRate);

            var messageBox = new Xafology.ExpressApp.SystemModule.GenericMessageBox(message);
        }
Exemplo n.º 2
0
 private static ForexRate GetForexRateObject(Session session, Currency fromCcy, Currency toCcy, DateTime convDate)
 {
     return(ForexRate.GetForexRateObject(fromCcy, toCcy, convDate));
 }