public ActionResult Edit([Bind(Include = "Id,Category1,Description,Active,CreateDateTime,UpdateDateTime")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "Id,Description,ImagURL,ProductId,Active,CreateDateTime,UpdateDateTime")] ProductImage productImage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productImage).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ProductId = new SelectList(db.Products, "Id", "Description", productImage.ProductId);
     return View(productImage);
 }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "Id,Description,Model,Price,Keywords,CategoryId,Active")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Category1", product.CategoryId);
     return(View(product));
 }
 public void Update(T obj)
 {
     table.Attach(obj);
     _context.Entry(obj).State = EntityState.Modified;
 }