Esempio n. 1
0
        private void FixupEmployee1(Employee previousValue)
        {
            if (previousValue != null && previousValue.Employees1.Contains(this))
            {
                previousValue.Employees1.Remove(this);
            }

            if (Employee1 != null)
            {
                if (!Employee1.Employees1.Contains(this))
                {
                    Employee1.Employees1.Add(this);
                }
                if (ReportsTo != Employee1.EmployeeID)
                {
                    ReportsTo = Employee1.EmployeeID;
                }
            }
            else if (!_settingFK)
            {
                ReportsTo = null;
            }
        }
Esempio n. 2
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && previousValue.Orders.Contains(this))
            {
                previousValue.Orders.Remove(this);
            }

            if (Employee != null)
            {
                if (!Employee.Orders.Contains(this))
                {
                    Employee.Orders.Add(this);
                }
                if (EmployeeID != Employee.EmployeeID)
                {
                    EmployeeID = Employee.EmployeeID;
                }
            }
            else if (!_settingFK)
            {
                EmployeeID = null;
            }
        }