public int Delete(int EmployeeExperienceID, int UserIdentity) { try { using (var db = new HCMEntities()) { EmployeesExperiences EmployeeExperienceObj = db.EmployeesExperiences.SingleOrDefault(x => x.EmployeeExperienceID.Equals(EmployeeExperienceID)); db.EmployeesExperiences.Remove(EmployeeExperienceObj); return db.SaveChanges(UserIdentity); } } catch { throw; } }
public int Insert(EmployeesExperiences EmployeeExperience) { try { using (var db = new HCMEntities()) { db.EmployeesExperiences.Add(EmployeeExperience); db.SaveChanges(); return EmployeeExperience.EmployeeExperienceID; } } catch { throw; } }
public int Update(EmployeesExperiences EmployeeExperience) { try { using (var db = new HCMEntities()) { EmployeesExperiences EmployeeExperienceObj = db.EmployeesExperiences.SingleOrDefault(x => x.EmployeeExperienceID.Equals(EmployeeExperience.EmployeeExperienceID)); EmployeeExperienceObj.EmployeeCodeID = EmployeeExperience.EmployeeCodeID; EmployeeExperienceObj.TotalYears = EmployeeExperience.TotalYears; EmployeeExperienceObj.TotalMonths = EmployeeExperience.TotalMonths; EmployeeExperienceObj.TotalDays = EmployeeExperience.TotalDays; EmployeeExperienceObj.LastUpdatedDate = EmployeeExperience.LastUpdatedDate; EmployeeExperienceObj.LastUpdatedBy = EmployeeExperience.LastUpdatedBy; return db.SaveChanges(); } } catch { throw; } }