示例#1
0
 public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,IsActive,Designation,MobileNo")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
 public ActionResult Edit([Bind(Include = "Id,EmployeeId,Address1,Address2,City,State,Country")] EmployeeAddress employeeAddress)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employeeAddress).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", employeeAddress.EmployeeId);
     return(View(employeeAddress));
 }