public ActionResult Edit([Bind(Include = "EmpID,Ename,JOB,Salary,DeptID")] EMP eMP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eMP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DeptID = new SelectList(db.DEPTs, "DeptID", "Dname", eMP.DeptID);
     return(View(eMP));
 }
Esempio n. 2
0
 public T Update(T model)
 {
     dbSet.Attach(model);
     context.Entry(model).State = EntityState.Modified;
     return(model);
 }
Esempio n. 3
0
 public ActionResult Edit(EMP obj)
 {
     _dbContext.Entry(obj).State = EntityState.Modified;
     _dbContext.SaveChanges();
     return(RedirectToAction("Index"));
 }