Example #1
0
 public void InsertAccount(Account account)
 {
     _daoManager.BeginTransaction();
     try
     {
         _accountDao.InsertAccount(account);
         _daoManager.CommitTransaction();
     }
     catch
     {
         _daoManager.RollBackTransaction();
         throw;
     }
 }
        public void InsertOrder(Order order)
        {
            // Get the next id within a separate transaction
            order.Id = GetNextId("OrderNum");

            _daoManager.BeginTransaction();
            try
            {
                _itemDao.UpdateQuantity(order);
                _orderDao.InsertOrder(order);

                _daoManager.CommitTransaction();
            }
            catch
            {
                _daoManager.RollBackTransaction();
                throw;
            }
        }