public void Delete(object obj) { Employee employee = db.Employees.Find(obj); db.Employees.Remove(employee); db.SaveChanges(); }
public void Delete(object Id) { AnnualLeave annualLeave = db.AnnualLeaves.Find(Id); db.AnnualLeaves.Remove(annualLeave); db.SaveChanges(); }
public void Delete(object Id) { EmployeeLeave employeeLeave = db.EmployeeLeaves.Find(Id); db.EmployeeLeaves.Remove(employeeLeave); db.SaveChanges(); }
public EmployeeAddress Insert(EmployeeAddress obj) { try { db.EmployeeAddresses.Add(obj); db.SaveChanges(); } catch (DbEntityValidationException ex) { foreach (var eve in ex.EntityValidationErrors) { var error = eve.ValidationErrors; } } return(obj); }