public ActionResult Manage([Bind(Include = "UserNameID,UserName,Password,Role,FullName,Birthday,Email,Address,Phone")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Store")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "BranchID,BranchName")] Branch branch) { if (ModelState.IsValid) { db.Entry(branch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(branch)); }
public ActionResult Edit([Bind(Include = "ProducTypeID,ProductTypeName")] ProductType producttype) { if (ModelState.IsValid) { db.Entry(producttype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(producttype)); }
public ActionResult Edit([Bind(Include = "OrderID,UserNameID,OrderDate,Total,DeliveryAddress,PhoneContact")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserNameID = new SelectList(db.Users, "UserNameID", "UserName", order.UserNameID); return(View(order)); }
public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,ProductTypeID")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductTypeID = new SelectList(db.ProductTypes, "ProducTypeID", "ProductTypeName", category.ProductTypeID); return(View(category)); }
public ActionResult Edit([Bind(Include = "OrderDetailID,OrderID,ProductID,Quantity,UnitPrice")] OrderDetail orderdetail) { if (ModelState.IsValid) { db.Entry(orderdetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrderID = new SelectList(db.Orders, "OrderID", "UserNameID", orderdetail.OrderID); ViewBag.ProductID = new SelectList(db.Products, "ProductID", "CategoryID", orderdetail.ProductID); return(View(orderdetail)); }
public ActionResult Edit([Bind(Include = "ProductID,CategoryID,ProductName,BranchID,Description,Price,Quantity,images")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BranchID = new SelectList(db.Branches, "BranchID", "BranchName", product.BranchID); ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", product.CategoryID); return(View(product)); }