示例#1
0
        public string AddBid()
        {
            var db = new BidContext();

            db.Bids.Add(new Bid {
                BidTitle = "标题"
            });
            db.SaveChanges();
            return("success");
        }
示例#2
0
        private void PassAuction(decimal price)
        {
            priceTextBox.BackColor = System.Drawing.Color.Empty;
            BidsModel bidsModel = new BidsModel()
            {
                AuctionId = Id,
                UserId    = HttpContext.Current.User.Identity.GetUserId(),
                Id        = Guid.NewGuid().ToString(),
                Value     = price,
            };

            bidContext.Bids.Add(bidsModel);
            bidContext.SaveChanges();

            ExtensionMethods.RefreshDB();
            Response.Redirect("/AuctionDetails?Id=" + Id);
        }
示例#3
0
 public bool Bid(BidRequest bid)
 {
     _context.Bids.Add(new BidEntity(bid));
     _context.SaveChanges();
     return(true);
 }