private void FixupEmployee(Employee previousValue) { if (previousValue != null && previousValue.Customers.Contains(this)) { previousValue.Customers.Remove(this); } if (Employee != null) { if (!Employee.Customers.Contains(this)) { Employee.Customers.Add(this); } if (SupportRepId != Employee.EmployeeId) { SupportRepId = Employee.EmployeeId; } } else if (!_settingFK) { SupportRepId = null; } }
private void FixupEmployee2(Employee previousValue) { if (previousValue != null && previousValue.Employee1.Contains(this)) { previousValue.Employee1.Remove(this); } if (Employee2 != null) { if (!Employee2.Employee1.Contains(this)) { Employee2.Employee1.Add(this); } if (ReportsTo != Employee2.EmployeeId) { ReportsTo = Employee2.EmployeeId; } } else if (!_settingFK) { ReportsTo = null; } }