private void FixupSalesPerson(SalesPerson previousValue)
        {
            if (previousValue != null && previousValue.SalesPersonQuotaHistories.Contains(this))
            {
                previousValue.SalesPersonQuotaHistories.Remove(this);
            }

            if (SalesPerson != null)
            {
                if (!SalesPerson.SalesPersonQuotaHistories.Contains(this))
                {
                    SalesPerson.SalesPersonQuotaHistories.Add(this);
                }
                if (BusinessEntityID != SalesPerson.BusinessEntityID)
                {
                    BusinessEntityID = SalesPerson.BusinessEntityID;
                }
            }
        }
Ejemplo n.º 2
0
        private void FixupSalesPerson(SalesPerson previousValue)
        {
            if (previousValue != null && previousValue.SalesOrderHeaders.Contains(this))
            {
                previousValue.SalesOrderHeaders.Remove(this);
            }

            if (SalesPerson != null)
            {
                if (!SalesPerson.SalesOrderHeaders.Contains(this))
                {
                    SalesPerson.SalesOrderHeaders.Add(this);
                }
                if (SalesPersonID != SalesPerson.BusinessEntityID)
                {
                    SalesPersonID = SalesPerson.BusinessEntityID;
                }
            }
            else if (!_settingFK)
            {
                SalesPersonID = null;
            }
        }
Ejemplo n.º 3
0
        private void FixupSalesPerson(SalesPerson previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.Employee, this))
            {
                previousValue.Employee = null;
            }

            if (SalesPerson != null)
            {
                SalesPerson.Employee = this;
            }
        }