Пример #1
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Brand brand)
 {
     if (ModelState.IsValid)
     {
         db.Entry(brand).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(brand));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Model,SerialNumber,Wireless,Color,Price,Commentary,Count,BrandId")] Keyboard keyboard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(keyboard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BrandId = new SelectList(db.Brands, "Id", "Name", keyboard.BrandId);
     return(View(keyboard));
 }