private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && previousValue.EmployeeDepartmentHistories.Contains(this))
            {
                previousValue.EmployeeDepartmentHistories.Remove(this);
            }

            if (Employee != null)
            {
                if (!Employee.EmployeeDepartmentHistories.Contains(this))
                {
                    Employee.EmployeeDepartmentHistories.Add(this);
                }
                if (BusinessEntityID != Employee.BusinessEntityID)
                {
                    BusinessEntityID = Employee.BusinessEntityID;
                }
            }
        }
예제 #2
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.SalesPerson, this))
            {
                previousValue.SalesPerson = null;
            }

            if (Employee != null)
            {
                Employee.SalesPerson = this;
                if (BusinessEntityID != Employee.BusinessEntityID)
                {
                    BusinessEntityID = Employee.BusinessEntityID;
                }
            }
        }
예제 #3
0
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.Person, this))
            {
                previousValue.Person = null;
            }

            if (Employee != null)
            {
                Employee.Person = this;
            }
        }
        private void FixupEmployee(Employee previousValue)
        {
            if (previousValue != null && previousValue.PurchaseOrderHeaders.Contains(this))
            {
                previousValue.PurchaseOrderHeaders.Remove(this);
            }

            if (Employee != null)
            {
                if (!Employee.PurchaseOrderHeaders.Contains(this))
                {
                    Employee.PurchaseOrderHeaders.Add(this);
                }
                if (EmployeeID != Employee.BusinessEntityID)
                {
                    EmployeeID = Employee.BusinessEntityID;
                }
            }
        }
예제 #5
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 (BusinessEntityID != Employee.BusinessEntityID)
                {
                    BusinessEntityID = Employee.BusinessEntityID;
                }
            }
            else if (!_settingFK)
            {
                BusinessEntityID = null;
            }
        }