コード例 #1
0
ファイル: OrgUnit.cs プロジェクト: rickeygalloway/Test
        private void FixupCountry(Country previousValue)
        {
            if (previousValue != null && previousValue.OrgUnits.Contains(this))
            {
                previousValue.OrgUnits.Remove(this);
            }

            if (Country != null)
            {
                if (!Country.OrgUnits.Contains(this))
                {
                    Country.OrgUnits.Add(this);
                }
                if (CountryId != Country.Id)
                {
                    CountryId = Country.Id;
                }
            }
            else if (!_settingFK)
            {
                CountryId = null;
            }
        }
コード例 #2
0
ファイル: State.cs プロジェクト: rickeygalloway/Test
        private void FixupCountry(Country previousValue)
        {
            if (previousValue != null && previousValue.States.Contains(this))
            {
                previousValue.States.Remove(this);
            }

            if (Country != null)
            {
                if (!Country.States.Contains(this))
                {
                    Country.States.Add(this);
                }
                if (CountryId != Country.Id)
                {
                    CountryId = Country.Id;
                }
            }
        }