public string AddBid() { var db = new BidContext(); db.Bids.Add(new Bid { BidTitle = "标题" }); db.SaveChanges(); return("success"); }
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); }
public bool Bid(BidRequest bid) { _context.Bids.Add(new BidEntity(bid)); _context.SaveChanges(); return(true); }