Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
        public AuctionInfo ListAuction(string auctionId)
        {
            TransactionalAuctionService svc = GetTransactionalAuctionService();
            AuctionInfo ai = svc.ListAuction(auctionId);

            return(ai);
        }
        public AuctionInfo listPartialAuction(string auctionId)
        {
            AuctionInfo ai = GetTransactionalAuctionService().ListPartialAuction(auctionId);

            return(ai);
        }
        public AuctionInfo ListAuctionTwiceWithoutTransaction(string auctionId)
        {
            AuctionInfo ai = GetNonTransactionalAuctionService().ListAuctionTwiceWithoutTransaction(auctionId);

            return(ai);
        }
Exemplo n.º 6
0
 protected void PrintAuction(AuctionInfo ai)
 {
     Console.WriteLine("Auction: " + ai.AuctionID );
     Console.WriteLine("Description: " + ai.Description );
 }