Пример #1
0
        public static ITradingJournalEntry GetNewTradingJournalEntry(IDalSession session, string currency, DateTime transactionDate)
        {
            int journalID;
            string appSettingKey = string.Format("DefaultTransacties{0}", (string.IsNullOrEmpty(currency) ? "EUR" : currency.ToUpper()));
            journalID = int.Parse((string)(System.Configuration.ConfigurationManager.AppSettings.Get(appSettingKey)));

            IJournal journal = JournalMapper.GetJournal(session, journalID);
            string nextJournalEntryNumber = JournalEntryMapper.GetNextJournalEntryNumber(session, journal);
            //decimal exRate = 1M;
            //if (!journal.Currency.IsBase)
            //{
            //    IHistoricalExRate historicalExRate = HistoricalExRateMapper.GetHistoricalExRate(session, journal.Currency, transactionDate);
            //    if (historicalExRate == null)
            //        throw new ApplicationException(string.Format("No exchange rate can be found");

            //    exRate = historicalExRate.Rate;
            //}
            ITradingJournalEntry entry = new TradingJournalEntry(journal, nextJournalEntryNumber, transactionDate);
            return entry;
        }
Пример #2
0
 private static ITradingJournalEntry getNewBooking(IDalSession session, IJournal journal, DateTime transactionDate)
 {
     string nextJournalEntryNumber = JournalEntryMapper.GetNextJournalEntryNumber(session, journal);
     ITradingJournalEntry newTradingJournalEntry = new TradingJournalEntry(journal, nextJournalEntryNumber, transactionDate);
     return newTradingJournalEntry;
 }