I am working on a simple auction site for charity. I have an Item model for sales items and a Bid view where a user can enter a request and send it. This rate is accepted inside the element controller:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Bid(int itemID, int bidAmount)
{
if (ModelState.IsValid)
{
Item item = db.Items.Find(itemID);
if (bidAmount >= item.NextBid)
{
item.Bids++;
item.CurrentBid = bidAmount;
item.HighBidder = HttpContext.User.Identity.Name;
db.Entry(item).State = EntityState.Modified;
db.SaveChanges();
}
else
{
}
return View(item);
}
return RedirectToAction("Auction");
}
I would like to know how to display server check for user. For example, in the code above, it may turn out that the declared bet amount is no longer sufficient. In this case, I would like to show the user a message that they were outbid, etc.
, ? , , , - eBay. .