public void SaveBehavioralItems(int EmployeeId, List <int> Items) { var Header = new EmployeeAssignment(); var headerItem = this.EmployeeAssignmentByEmployeeId(EmployeeId); if (headerItem != null) { Header = headerItem; _dbContext.Entry(Header).State = EntityState.Modified; } else { Header.Id = 0; Header.Employee = EmployeeById(EmployeeId); _dbContext.Add(Header); } foreach (var item in Items) { var lineItem = new EmployeeBehavioralAssignment { EmployeeAssignment = Header, BehavioralFactor = BehavioralFactorById(item), IsDeleted = false, EvaluationSeason = ActiveSeason() }; _dbContext.Add(lineItem); } _dbContext.SaveChanges(); }
public void Save(EmployeeAssignment employeeAssignment, EmployeeKRAAssignment kraAssignment, EmployeeBehavioralAssignment behavioralAssignment) { }