示例#1
0
 public ActionResult Edit([Bind(Include = "CompanyID,CompanyName,ZipCode")] Company company)
 {
     if (ModelState.IsValid)
     {
         db.Entry(company).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(company));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "EmployeeID,CompanyID,EmployeeName,EmployeeEmail,Position,Interest1,Interest2,Interest3,Cuisine1,Cuisine2,Cuisine3")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", employee.CompanyID);
     return(View(employee));
 }