public static void BookJournalEntry(IDalSession session, IJournalEntry journalEntry)
        {
            journalEntry.BookLines();
            journalEntry.Status = JournalEntryStati.Booked;

            session.BeginTransaction();
            JournalEntryMapper.Update(session, journalEntry);
            session.CommitTransaction();
        }
Beispiel #2
0
        /// <summary>
        /// Begins a database transaction.
        /// </summary>
        /// <returns>A IDalSession</returns>
        public IDalSession BeginTransaction()
        {
            if (_daoSessionHandler == null)
            {
                throw new DataAccessException("DaoManager could not get DaoSession.  DaoSessionPool was null (possibly not configured).");
            }
            if (_sessionStore.LocalSession != null)
            {
                throw new DataAccessException("DaoManager could not invoke BeginTransaction(). A DaoSession is already started. Call CommitTransaction() or RollbackTransaction first.");
            }
            IDalSession session = _daoSessionHandler.GetDaoSession(this);

            _sessionStore.Store(session);
            session.BeginTransaction();
            return(session);
        }