public ActionResult Edit([Bind(Include = "ID,CatName,CatDescription")] 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,Name,Email,Question,Status")] Query query) { if (ModelState.IsValid) { db.Entry(query).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(query)); }
public ActionResult Edit([Bind(Include = "ID,CusName,CusPhone,CusEmail,CusAddress,OrderDate")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order)); }
public ActionResult Edit([Bind(Include = "ID,Name,Make,Price,CategoryId")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "ID", "CatName", product.CategoryId); return(View(product)); }
public ActionResult Edit([Bind(Include = "ProductID,OrderID,Quantity")] OrderDetail orderDetail) { if (ModelState.IsValid) { db.Entry(orderDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrderID = new SelectList(db.Orders, "ID", "CusName", orderDetail.OrderID); ViewBag.ProductID = new SelectList(db.Products, "ID", "Name", orderDetail.ProductID); return(View(orderDetail)); }