コード例 #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);
        }
コード例 #2
0
ファイル: CashFlow.cs プロジェクト: ewin66/CashDiscipline
 private static decimal GetForexRate(Session session, Currency fromCcy, Currency toCcy, DateTime convDate)
 {
     return(ForexRate.GetForexRate(fromCcy, toCcy, convDate));
 }
コード例 #3
0
ファイル: CashFlow.cs プロジェクト: ewin66/CashDiscipline
 private static ForexRate GetForexRateObject(Session session, Currency fromCcy, Currency toCcy, DateTime convDate)
 {
     return(ForexRate.GetForexRateObject(fromCcy, toCcy, convDate));
 }