示例#1
0
        public string Place2Bids(String auctionId1, String auctionId2, String bidId1, String bidId2, String userId, System.Double amount1, System.Double amount2, System.Double maxAmount1, System.Double maxAmount2)
        {
            string sql = "";

            try
            {
                IUser    user     = persistentAuctions.GetUser(userId);
                IAuction auction1 = persistentAuctions.GetAuction(auctionId1);
                IBid     newBid1  = persistentAuctions.CreateBid(bidId1, auction1, user, amount1, maxAmount1);
                IAuction auction2 = persistentAuctions.GetAuction(auctionId2);
                IBid     newBid2  = persistentAuctions.CreateBid(bidId2, auction2, user, amount2, maxAmount2);

                // 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();

                sql = persistentAuctions.Sql;
            }
            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);
            }
            return(sql);
        }
示例#2
0
 public Bid(IBid bid)
     : base(bid)
 {
     if (Value == null)
     {
         Value = new Value();
     }
 }
示例#3
0
 public BaseBid(IBid bid)
 {
     StringId         = bid.StringId;
     Date             = bid.Date;
     Status           = bid.Status;
     Value            = bid.Value;
     ParticipationUrl = bid.ParticipationUrl;
 }
示例#4
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.Bid == null))
     {
         IBid bidCasted = item.As <IBid>();
         if ((bidCasted != null))
         {
             this._parent.Bid = bidCasted;
             return;
         }
     }
 }
示例#5
0
 public BidInfo(IBid b)
 {
     if (b != null)
     {
         this.bidAmount    = b.Amount;
         this.maxBidAmount = b.MaxAmount;
         IUser u = b.Buyer;
         if (u != null)
         {
             buyer = u.Id;
         }
     }
 }
示例#6
0
 public BidInfo(IBid b)
 {
     if (b!=null)
     {
         this.bidAmount = b.Amount;
         this.maxBidAmount = b.MaxAmount;
         IUser u = b.Buyer;
         if (u!=null)
         {
             buyer = u.Id;
         }
     }
 }
示例#7
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.Bid == null))
     {
         IBid bidCasted = item.As <IBid>();
         if ((bidCasted != null))
         {
             this._parent.Bid = bidCasted;
             return;
         }
     }
     if ((this._parent.ProductBidClearing == null))
     {
         IProductBidClearing productBidClearingCasted = item.As <IProductBidClearing>();
         if ((productBidClearingCasted != null))
         {
             this._parent.ProductBidClearing = productBidClearingCasted;
             return;
         }
     }
     if ((this._parent.BidPriceCurve == null))
     {
         IBidPriceCurve bidPriceCurveCasted = item.As <IBidPriceCurve>();
         if ((bidPriceCurveCasted != null))
         {
             this._parent.BidPriceCurve = bidPriceCurveCasted;
             return;
         }
     }
     if ((this._parent.MarketProduct == null))
     {
         IMarketProduct marketProductCasted = item.As <IMarketProduct>();
         if ((marketProductCasted != null))
         {
             this._parent.MarketProduct = marketProductCasted;
             return;
         }
     }
 }
 public BidInfo CreateBidInfo(IBid bid)
 {
     return new BidInfo(bid);
 }
示例#9
0
 public BidListController()
 {
     this.repo        = new BidRepository();
     this.BidListRepo = new BidRepository();
 }
示例#10
0
 public BidDTO(IBid bid)
     : base(bid)
 {
 }
示例#11
0
 public BidInfo CreateBidInfo(IBid bid)
 {
     return(new BidInfo(bid));
 }