public ActionResult Edit([Bind(Include = "AssetID,AssetLocation,AssetName,AssetType,AssetStock,AssetPrice")] Asset asset) { if (ModelState.IsValid) { db.Entry(asset).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(asset)); }
public ActionResult Edit([Bind(Include = "DepartmentID,DepartmentName")] Department department) { if (ModelState.IsValid) { db.Entry(department).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(department)); }
public ActionResult Edit([Bind(Include = "EmployeeID,EmployeeTitle,EmployeeFirstName,EmployeeLastName,EmployeeAddress,EmployeePhone,EmployeeEmail,DepartmentID")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "DepartmentName", employee.DepartmentID); return(View(employee)); }