コード例 #1
0
        public AuctionInfo ListPartialAuction(String auctionId)
        {
            try
            {
                IAuction    auction = persistentAuctions.GetPartialAuction(auctionId);
                AuctionInfo ai      = persistentAuctions.CreateAuctionInfo(auction, true);

                // The next operation is for Object-Relational mapping software that needs to be explicitly cleaned up.
                // Those that do not simply ignore this operation.
                persistentAuctions.Close();

                ai.Sql = persistentAuctions.Sql;

                return(ai);
            }
            catch (Exception e)
            {
                // The next operation is for Object-Relational mapping software that needs to be explicitly cleaned up.
                // Those that do not simply ignore this operation.
                if (persistentAuctions != null)
                {
                    persistentAuctions.Close();
                }
                throw new AuctionServiceException(e);
            }
        }
コード例 #2
0
        public AuctionInfo ListAuctionTwiceWithTransaction(String auctionId)
        {
            try
            {
                TransactionalAuctionService service = new TransactionalAuctionService();
                service.SetPersistenceFactory(this.persistenceFactory);
                AuctionInfo ai = service.ListAuction(auctionId);

                string sql = ai.Sql;

                service = new TransactionalAuctionService();
                service.SetPersistenceFactory(this.persistenceFactory);
                ai = service.ListAuction(auctionId);

                ai.Sql = sql + ai.Sql;

                return(ai);
            }
            catch (Exception e)
            {
                // The next operation is for Object-Relational mapping software that needs to be explicitly cleaned up.
                // Those that do not simply ignore this operation.
                if (persistentAuctions != null)
                {
                    persistentAuctions.Close();
                }
                throw new AuctionServiceException(e);
            }
        }
コード例 #3
0
        public AuctionInfo ListAuction(string auctionId)
        {
            TransactionalAuctionService svc = GetTransactionalAuctionService();
            AuctionInfo ai = svc.ListAuction(auctionId);

            return(ai);
        }
コード例 #4
0
        public AuctionInfo listPartialAuction(string auctionId)
        {
            AuctionInfo ai = GetTransactionalAuctionService().ListPartialAuction(auctionId);

            return(ai);
        }
コード例 #5
0
        public AuctionInfo ListAuctionTwiceWithoutTransaction(string auctionId)
        {
            AuctionInfo ai = GetNonTransactionalAuctionService().ListAuctionTwiceWithoutTransaction(auctionId);

            return(ai);
        }
コード例 #6
0
 protected void PrintAuction(AuctionInfo ai)
 {
     Console.WriteLine("Auction: " + ai.AuctionID );
     Console.WriteLine("Description: " + ai.Description );
 }