public ActionResult Create([Bind(Include = "ID,Name,Description,Seller")] Item item)
        {
            if (ModelState.IsValid)
            {
                db.Items.Add(item);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Seller = new SelectList(db.Sellers, "SellerName", "SellerName", item.Seller);
            return(View(item));
        }
        public ActionResult Bid([Bind(Include = "ID,Item,Buyer,Price,Timestamp")] Bid BidObject)
        {
            EFdbContext db = new EFdbContext();

            db.Bids.Add(BidObject);
            db.SaveChanges();

            //return a different page or error
            return(View("confirmation"));
        }
 public void Create(ClientProfile item)
 {
     db.ClientProfiles.Add(item);
     db.SaveChanges();
 }
Example #4
0
 public void Save()
 {
     db.SaveChanges();
 }