public ActionResult Edit([Bind(Include = "ShipperID,CompanyName,Phone")] Shipper shipper) { if (ModelState.IsValid) { db.Entry(shipper).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shipper)); }
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)); }
public ActionResult Edit([Bind(Include = "EmployeeID,LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,City,Region,PostalCode,Country,HomePhone,Extension,Photo,Notes,ReportsTo,PhotoPath")] Employees employees) { if (ModelState.IsValid) { db.Entry(employees).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ReportsTo = new SelectList(db.Employees, "EmployeeID", "LastName", employees.ReportsTo); return(View(employees)); }
public ActionResult Edit([Bind(Include = "OrderID,CustomerID,EmployeeID,OrderDate,RequiredDate,ShippedDate,ShipVia,Freight,ShipName,ShipAddress,ShipCity,ShipRegion,ShipPostalCode,ShipCountry")] Orders orders) { if (ModelState.IsValid) { db.Entry(orders).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "CompanyName", orders.CustomerID); ViewBag.EmployeeID = new SelectList(db.Employees, "EmployeeID", "LastName", orders.EmployeeID); ViewBag.ShipVia = new SelectList(db.Shippers, "ShipperID", "CompanyName", orders.ShipVia); return(View(orders)); }