Example #1
0
        public ActionResult AddFurniture()
        {
            FurnitureDb           db = new FurnitureDb(_connectionString);
            AddFurnitureViewModel vm = new AddFurnitureViewModel
            {
                Count = db.GetTotalCount()
            };

            return(View(vm));
        }
Example #2
0
        public ActionResult AddFurniture(string name, string color, decimal price, int quantityInStock)
        {
            FurnitureDb db = new FurnitureDb(_connectionString);

            db.Add(new Furniture
            {
                Name            = name,
                Color           = color,
                Price           = price,
                QuantityInStock = quantityInStock
            });

            return(Redirect("/postdemo/AddFurniture"));
        }