Exemple #1
0
        public ActionResult Create([Bind(Include = "Model,SerialNumber,Wireless,Color,Price,Commentary,Count,BrandId")] Keyboard keyboard)
        {
            if (ModelState.IsValid)
            {
                Stock.AddKeyboard(keyboard);
                return(RedirectToAction("Index"));
            }

            ViewBag.BrandId = new SelectList(db.Brands.OrderBy(a => a.Name), "Id", "FullName", keyboard.BrandId);
            return(View(keyboard));
        }