Example #1
0
 public ActionResult Edit([Bind(Include = "CustomerId,Firstname,Lastname,Adress,Zip,City")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
 public ActionResult Edit([Bind(Include = "SizeId,Name")] Size size)
 {
     if (ModelState.IsValid)
     {
         db.Entry(size).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(size));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "ProductId,Name,Price,Image,Description,Specs,SizeId")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SizeId = new SelectList(db.Size, "SizeId", "Name", product.SizeId);
     return(View(product));
 }