示例#1
0
        private DataEF.Season GetSeason()
        {
            var season = new DataEF.Season
            {
                Number     = SourceSeason.Number,
                SeasonType = dbSeasonType,
                League     = dbLeague,
            };

            Database.Seasons.Add(season);
            return(season);
        }
示例#2
0
        private DataEF.SkaterSeasonStat SetSkaterStats(DataEF.Season dbSeason, DataEF.Skater dbSkater, SthsData.SkaterSeasonStats skaterStats)
        {
            var dbSeasonStats = new DataEF.SkaterSeasonStat()
            {
                Season = dbSeason,
                Skater = dbSkater,
                Team   = DataDB,
            };

            PopulateSkaterStats(dbSeasonStats, skaterStats);
            Database.SkaterSeasonStats.Add(dbSeasonStats);
            return(dbSeasonStats);
        }
示例#3
0
        private DataEF.GoalieSeasonStat SetGoalieStats(DataEF.Season dbSeason, DataEF.Goalie dbGoalie, SthsData.GoalieSeasonStats goalieStats)
        {
            var dbSeasonStats = new DataEF.GoalieSeasonStat()
            {
                Season = dbSeason,
                Goalie = dbGoalie,
                Team   = DataDB,
            };

            PopulateGoalieStats(dbSeasonStats, goalieStats);
            Database.GoalieSeasonStats.Add(dbSeasonStats);
            return(dbSeasonStats);
        }
示例#4
0
        private DataEF.SkaterSeasonStat SetSubtotalSkaterStats(DataEF.Season dbSeason, DataEF.Skater dbSkater, SthsData.SkaterSeasonStats skaterStats)
        {
            var dbSeasonSubtotalStats = new DataEF.SkaterSeasonStat()
            {
                Season     = dbSeason,
                Skater     = dbSkater,
                Team       = dbSeason.Teams.Where(a => a.Acronym == skaterStats.TeamAcronym).First(),
                IsSubtotal = true
            };

            PopulateSkaterStats(dbSeasonSubtotalStats, skaterStats);
            Database.SkaterSeasonStats.Add(dbSeasonSubtotalStats);
            return(dbSeasonSubtotalStats);
        }
示例#5
0
        private DataEF.GoalieSeasonStat SetSubtotalGoalieStats(DataEF.Season dbSeason, DataEF.Goalie dbGoalie, SthsData.GoalieSeasonStats goalieStats)
        {
            var dbSeasonStats = new DataEF.GoalieSeasonStat()
            {
                Season     = dbSeason,
                Goalie     = dbGoalie,
                Team       = dbSeason.Teams.Where(a => a.Acronym == goalieStats.TeamAcronym).First(),
                IsSubtotal = true,
            };

            PopulateGoalieStats(dbSeasonStats, goalieStats);
            Database.GoalieSeasonStats.Add(dbSeasonStats);
            return(dbSeasonStats);
        }
示例#6
0
        public void SetGoaliesAndStats(DataEF.Season dbSeason)
        {
            foreach (var sourceGoalie in DataSource.Goalies)
            {
                var dbGoalie = GetGoalieFromDB(sourceGoalie);
                SetGoalieStats(dbSeason, dbGoalie, sourceGoalie.SeasonTotals);

                // If the team was traded, add the subtotal seasons as well
                if (sourceGoalie.SeasonSubTotals != null)
                {
                    foreach (var subTotal in sourceGoalie.SeasonSubTotals)
                    {
                        SetSubtotalGoalieStats(dbSeason, dbGoalie, subTotal);
                    }
                }
            }
        }
示例#7
0
        public void SetSkatersAndStats(DataEF.Season dbSeason)
        {
            foreach (var sourceSkater in DataSource.Skaters)
            {
                var dbSkater = GetSkaterFromDB(sourceSkater);
                SetSkaterStats(dbSeason, dbSkater, sourceSkater.SeasonTotals);

                // If the team was traded, add the subtotal seasons as well
                if (sourceSkater.SeasonSubTotals != null)
                {
                    foreach (var subTotal in sourceSkater.SeasonSubTotals)
                    {
                        SetSubtotalSkaterStats(dbSeason, dbSkater, subTotal);
                    }
                }
            }
        }