Пример #1
0
 public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,Description,Picture")] Categories categories)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categories));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "SupplierID,CompanyName,ContactName,ContactTitle,Address,City,Region,PostalCode,Country,Phone,Fax,HomePage")] Suppliers suppliers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(suppliers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(suppliers));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "LoginID,UserName,PassWord,LoginErrorMessage")] Login login)
 {
     if (ModelState.IsValid)
     {
         db.Entry(login).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(login));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "ShipperID,CompanyName,Phone")] Shippers shippers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(shippers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(shippers));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "TerritoryID,TerritoryDescription,RegionID")] Territories territories)
 {
     if (ModelState.IsValid)
     {
         db.Entry(territories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RegionID = new SelectList(db.Region, "RegionID", "RegionDescription", territories.RegionID);
     return(View(territories));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "OrderID,ProductID,UnitPrice,Quantity,Discount")] Order_Details order_Details)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order_Details).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OrderID   = new SelectList(db.Orders, "OrderID", "CustomerID", order_Details.OrderID);
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "ProductName", order_Details.ProductID);
     return(View(order_Details));
 }
Пример #7
0
 public ActionResult Edit([Bind(Include = "ProductID,ProductName,SupplierID,CategoryID,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder,ReorderLevel,Discontinued")] Products products)
 {
     if (ModelState.IsValid)
     {
         db.Entry(products).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", products.CategoryID);
     ViewBag.SupplierID = new SelectList(db.Suppliers, "SupplierID", "CompanyName", products.SupplierID);
     return(View(products));
 }