public ActionResult Edit(int id, Products p1) { Products p = context.Products.Where(x => x.ProductId == p1.ProductId).SingleOrDefault(); context.Entry(p).CurrentValues.SetValues(p1); context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, Categories c1) { Categories c = context.Categories.Where(x => x.CategoryId == c1.CategoryId).SingleOrDefault(); context.Entry(c).CurrentValues.SetValues(c1); context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, Vendors v1) { Vendors v = context.Vendors.Where(x => x.VendorId == v1.VendorId).SingleOrDefault(); context.Entry(v).CurrentValues.SetValues(v1); context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, Brands b1) { Brands b = context.Brands.Where(x => x.BrandId == b1.BrandId).SingleOrDefault(); context.Entry(b).CurrentValues.SetValues(b1); context.SaveChanges(); return(RedirectToAction("Index")); }