コード例 #1
0
        private int GetSeasonYearsId(string seasonYears)
        {
            var seasonYearsRepo = new SeasonYearsRepository();

            int existingYears = seasonYearsRepo.GetSeasonYearsBySeasonString(seasonYears);

            if (existingYears == 0)
            {
                var seasonYear = new SeasonYear();
                seasonYear.Years = seasonYears;
                seasonYearsRepo.Save(seasonYear);
                existingYears = seasonYear.SeasonYearsId;
            }

            return existingYears;
        }
コード例 #2
0
ファイル: Season.cs プロジェクト: cataylor/bananasplit
        private void FixupSeasonYear(SeasonYear previousValue)
        {
            if (previousValue != null && previousValue.Seasons.Contains(this))
            {
                previousValue.Seasons.Remove(this);
            }

            if (SeasonYear != null)
            {
                if (!SeasonYear.Seasons.Contains(this))
                {
                    SeasonYear.Seasons.Add(this);
                }
                if (SeasonYearsId != SeasonYear.SeasonYearsId)
                {
                    SeasonYearsId = SeasonYear.SeasonYearsId;
                }
            }
        }