コード例 #1
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && previousValue.EmployeeAddresses.Contains(this))
            {
                previousValue.EmployeeAddresses.Remove(this);
            }

            if (Employee != null)
            {
                if (!Employee.EmployeeAddresses.Contains(this))
                {
                    Employee.EmployeeAddresses.Add(this);
                }
                if (EmployeeID != Employee.EmployeeID)
                {
                    EmployeeID = Employee.EmployeeID;
                }
            }
        }
コード例 #2
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && previousValue.JobCandidates.Contains(this))
            {
                previousValue.JobCandidates.Remove(this);
            }

            if (Employee != null)
            {
                if (!Employee.JobCandidates.Contains(this))
                {
                    Employee.JobCandidates.Add(this);
                }
                if (EmployeeID != Employee.EmployeeID)
                {
                    EmployeeID = Employee.EmployeeID;
                }
            }
            else if (!_settingFK)
            {
                EmployeeID = null;
            }
        }
コード例 #3
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.SalesPerson, this))
            {
                previousValue.SalesPerson = null;
            }

            if (Employee != null)
            {
                Employee.SalesPerson = this;
                if (SalesPersonID != Employee.EmployeeID)
                {
                    SalesPersonID = Employee.EmployeeID;
                }
            }
        }
コード例 #4
0
        private void FixupEmployee2(Employee previousValue)
        {
            if (previousValue != null
                && previousValue.Employees.Contains(this))
            {
                previousValue.Employees.Remove(this);
            }

            if (Manager != null)
            {
                if (!Manager.Employees.Contains(this))
                {
                    Manager.Employees.Add(this);
                }
                if (ManagerID != Manager.EmployeeID)
                {
                    ManagerID = Manager.EmployeeID;
                }
            }
            else if (!_settingFK)
            {
                ManagerID = null;
            }
        }