public int Delete(int EmployeeExperienceWithDetailID, int UserIdentity) { try { using (var db = new HCMEntities()) { EmployeeExperiencesWithDetails EmployeeExperiencesWithDetailObj = db.EmployeeExperiencesWithDetails.SingleOrDefault(x => x.EmployeeExperienceWithDetailID.Equals(EmployeeExperienceWithDetailID)); db.EmployeeExperiencesWithDetails.Remove(EmployeeExperiencesWithDetailObj); return(db.SaveChanges(UserIdentity)); } } catch { throw; } }
public int Insert(EmployeeExperiencesWithDetails EmployeeExperiencesWithDetail) { try { using (var db = new HCMEntities()) { db.EmployeeExperiencesWithDetails.Add(EmployeeExperiencesWithDetail); db.SaveChanges(); return(EmployeeExperiencesWithDetail.EmployeeExperienceWithDetailID); } } catch { throw; } }
public int Update(EmployeeExperiencesWithDetails EmployeeExperiencesWithDetail) { try { using (var db = new HCMEntities()) { EmployeeExperiencesWithDetails EmployeeExperiencesWithDetailObj = db.EmployeeExperiencesWithDetails.SingleOrDefault(x => x.EmployeeExperienceWithDetailID.Equals(EmployeeExperiencesWithDetail.EmployeeExperienceWithDetailID)); EmployeeExperiencesWithDetailObj.EmployeeCodeID = EmployeeExperiencesWithDetail.EmployeeCodeID; EmployeeExperiencesWithDetailObj.FromDate = EmployeeExperiencesWithDetail.FromDate; EmployeeExperiencesWithDetailObj.ToDate = EmployeeExperiencesWithDetail.ToDate; EmployeeExperiencesWithDetailObj.JobName = EmployeeExperiencesWithDetail.JobName; EmployeeExperiencesWithDetailObj.SectorName = EmployeeExperiencesWithDetail.SectorName; EmployeeExperiencesWithDetailObj.SectorTypeID = EmployeeExperiencesWithDetail.SectorTypeID; EmployeeExperiencesWithDetailObj.LastUpdatedDate = EmployeeExperiencesWithDetail.LastUpdatedDate; EmployeeExperiencesWithDetailObj.LastUpdatedBy = EmployeeExperiencesWithDetail.LastUpdatedBy; return(db.SaveChanges()); } } catch { throw; } }