public ActionResult Edit([Bind(Include = "ID,Name,Categories,Quantity,Price,Picture,Description")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Categories = new SelectList(db.Categories, "ID", "CategoriesName", product.Categories); return(View(product)); }
public ActionResult Edit([Bind(Include = "ID,LoginId,Password,FirstName,LastName,Address,Gender,Phonenumber,UserRole")] tblUser tblUser) { if (ModelState.IsValid) { db.Entry(tblUser).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserRole = new SelectList(db.tblRoles, "ID", "UserRole", tblUser.UserRole); return(View(tblUser)); }