public ActionResult Edit([Bind(Include = "Id,Title")] Designation designation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(designation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(designation));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,DesignationId,JoiningDate")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DesignationId = new SelectList(db.Designations, "Id", "Title", employee.DesignationId);
     return(View(employee));
 }