public ActionResult Edit(ProductCategory productcategory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productcategory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(productcategory));
 }
Exemple #2
0
 public ActionResult Edit(Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductCatID = new SelectList(db.ProductCategories, "ProductCatID", "ProductCatName", product.ProductCatID);
     return(View(product));
 }
Exemple #3
0
 public ActionResult Edit(Car car)
 {
     if (ModelState.IsValid)
     {
         db.Entry(car).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CarCatID = new SelectList(db.CarCategories, "CatID", "CatName", car.CarCatID);
     return(View(car));
 }
Exemple #4
0
 public ActionResult Edit(CarItem caritem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(caritem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CarID     = new SelectList(db.Cars, "CarID", "Model", caritem.CarID);
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Image", caritem.ProductID);
     return(View(caritem));
 }