public ActionResult Edit([Bind(Include = "id,name,content,created_at")] 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,password,phone,address,create_at")] user user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "id,user_id,status,node,total,created_at")] order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.user_id = new SelectList(db.users, "id", "name", order.user_id); return(View(order)); }
public ActionResult Edit([Bind(Include = "id,name,category_id,image,unitPrice,created_at")] product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.category_id = new SelectList(db.categories, "id", "name", product.category_id); ViewBag.id = new SelectList(db.orderDetails, "product_id", "product_id", product.id); return(View(product)); }
public ActionResult Edit([Bind(Include = "product_id,order_id,price,quantity,created_at")] orderDetail orderDetail) { if (ModelState.IsValid) { db.Entry(orderDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.order_id = new SelectList(db.orders, "id", "status", orderDetail.order_id); ViewBag.product_id = new SelectList(db.products, "id", "name", orderDetail.product_id); return(View(orderDetail)); }