public void Update(Department obj) { EmployeeMgtSystemEntities db = new EmployeeMgtSystemEntities(); Department department = db.Departments.Single(u => u.Id == obj.Id); department.DepttName = obj.DepttName; db.Departments.Attach(department); db.Entry(department).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void Update(Design obj) { EmployeeMgtSystemEntities db = new EmployeeMgtSystemEntities(); Design design = db.Designs.Single(u => u.Id == obj.Id); design.DesignationName = obj.DesignationName; db.Designs.Attach(design); db.Entry(design).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void Update(Employee obj) { EmployeeMgtSystemEntities db = new EmployeeMgtSystemEntities(); Employee employee = db.Employees.Single(u => u.Id == obj.Id); employee.Name = obj.Name; employee.Email = obj.Email; employee.Address = obj.Address; employee.Mobile = obj.Mobile; employee.DepttId = obj.DepttId; employee.DesigId = obj.DesigId; db.Employees.Attach(employee); db.Entry(employee).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }