示例#1
0
 public ActionResult Edit([Bind(Include = "SupplierID,CompanyName,Address,Phone")] Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(supplier));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "UserName,Password,Role")] Account account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(account));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,Description")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "CustomerID,Password,ContactName,Address,Phone")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
 public ActionResult Edit([Bind(Include = "OrderID,ProductID,UnitPrice,Quantity")] Order_Detail order_Detail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order_Detail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OrderID   = new SelectList(db.Orders, "OrderID", "CustomerID", order_Detail.OrderID);
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "ProductName", order_Detail.ProductID);
     return(View(order_Detail));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "ProductID,ProductName,SupplierID,CategoryID,Quantity,UnitPrice,ProductImage,Description")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", product.CategoryID);
     ViewBag.SupplierID = new SelectList(db.Suppliers, "SupplierID", "CompanyName", product.SupplierID);
     return(View(product));
 }