Beispiel #1
0
        /// <summary>
        /// This will use GET and return a CreateBid View.
        /// </summary>
        /// <returns>CreateBid View</returns>
        public ActionResult CreateBid()
        {
            BuyerItem BuyersAndItems = new BuyerItem
            {
                Buyers = db.Buyers,
                Items  = db.Items
            };

            return(View(BuyersAndItems));
        }
Beispiel #2
0
        public ActionResult CreateBid([Bind(Include = "ItemID,BuyerID,Price")] Bid bid)
        {
            bid.TimeStamp = DateTime.Now;
            if (ModelState.IsValid)
            {
                db.Bids.Add(bid);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            BuyerItem BuyersAndItems = new BuyerItem
            {
                Buyers = db.Buyers,
                Items  = db.Items
            };

            return(View(BuyersAndItems));
        }