public PlayersController() { _entities = new KSULaxEntities(); _playerBL = new PlayerBL(_entities); _gameBL = new GameBL(_entities); _awardBL = new AwardBL(_entities); }
public void UpdateGames(List <GameBE> games) { using (var ent = new KSULaxEntities()) { foreach (GameBE gbe in games) { var game = ((from g in ent.GameSet where g.id == gbe.ID select g) as ObjectQuery <GameEntity>) .Take <GameEntity>(1) .FirstOrDefault <GameEntity>(); if (null == game) { ent.GameSet.AddObject(GetGameEntity(gbe)); } else { game.away_team_score = gbe.AwayTeamScore; game.away_team_slug = gbe.AwayTeamSlug.Trim(); game.game_datetime = gbe.Datetime; game.game_season_id = (short)gbe.SeasonID; game.game_status = gbe.Status.Trim(); game.game_type = gbe.Type.Trim(); game.home_team_score = gbe.HomeTeamScore; game.home_team_slug = gbe.HomeTeamSlug.Trim(); game.id = (short)gbe.ID; game.venue = gbe.Venue.Trim(); } } ent.SaveChanges(); } }
public void UpdatePoll(TeamRankingBE poll) { using (var ent = new KSULaxEntities()) { var pe = ((from p in ent.PollSet where p.pollsource_id == poll.pollSource && p.date == poll.Date select p) as ObjectQuery <PollEntity>) .Take <PollEntity>(1) .FirstOrDefault <PollEntity>(); if (null == pe) { ent.PollSet.AddObject(GetPollEntity(poll)); } else { pe.rank = poll.Rank; pe.url = poll.Url; } ent.SaveChanges(); } }
/// <summary> /// Updates the game stats per game. Only use to update stats for entire games. All stats for included games are cleared out prior to update. /// </summary> /// <param name="gsbeLst">List of Game Stats to Update</param> public void UpdateGameStatByGame(List <GameStatBE> gsbeLst) { using (var ent = new KSULaxEntities()) { var games = from n in gsbeLst group n by n.GameID into nGroup select nGroup.Key; foreach (var game in games) { var pge = ((from g in ent.GameSet where g.id == (short)game select g) as ObjectQuery <GameEntity>) .Include("PlayerGames") .Take <GameEntity>(1) .FirstOrDefault <GameEntity>(); pge.PlayerGames.Clear(); } ent.SaveChanges(); foreach (GameStatBE gsbe in gsbeLst) { var pge = ((from pg in ent.PlayerGameSet where pg.game_id == gsbe.GameID && pg.player_id == gsbe.PlayerID select pg) as ObjectQuery <PlayerGameEntity>) .Take <PlayerGameEntity>(1) .FirstOrDefault <PlayerGameEntity>(); if (null == pge) { ent.PlayerGameSet.AddObject(GetPlayerGameEntity(gsbe)); } else { pge.assists = (short)gsbe.Assists; pge.ga = (short)gsbe.GoalsAgainst; pge.game_id = (short)gsbe.GameID; pge.goals = (short)gsbe.Goals; pge.player_id = (short)gsbe.PlayerID; pge.saves = (short)gsbe.Saves; } } ent.SaveChanges(); } }
public void UpdatePlayers(List <PlayerBE> players) { using (var ent = new KSULaxEntities()) { foreach (PlayerBE pbe in players) { var player = ((from p in ent.PlayerSet where p.id == pbe.PlayerID select p) as ObjectQuery <PlayerEntity>) .Include("PlayerSeason") .Take <PlayerEntity>(1) .FirstOrDefault <PlayerEntity>(); if (null == player) { ent.PlayerSet.AddObject(GetPlayerEntity(pbe)); } else { player.first = pbe.FirstName.Trim(); player.highschool = pbe.HighSchool.Trim(); player.homestate = pbe.HomeState.Trim(); player.hometown = pbe.Hometown.Trim(); player.last = pbe.LastName.Trim(); player.major = pbe.Major.Trim(); player.middle = pbe.MiddleName.Trim(); var playerseason = player.PlayerSeason.Single(x => x.season_id.Equals((short)pbe.SeasonID)); if (null != playerseason) { playerseason.@class = pbe.ClassYr.Trim(); playerseason.eligibility = pbe.EligibilityYr.Trim(); playerseason.height = (short)pbe.Height; playerseason.jersey = (short)pbe.JerseyNum; playerseason.position = pbe.Position.Trim(); playerseason.weight = (short)pbe.Weight; playerseason.team = pbe.Team.Trim(); } player.PlayerSeason.Add(playerseason); } } ent.SaveChanges(); } }
public GameBL(KSULaxEntities entitity) { _entities = entitity; }
public GamesController() { _entities = new KSULaxEntities(); _gamesBL = new GameBL(_entities); _photoBL = new PhotoBL(_entities); }
public ScheduleController() { _entities = new KSULaxEntities(); }
public SponsorsController() { _entities = new KSULaxEntities(); _gamesBL = new GameBL(_entities); }
public RosterController() { _entities = new KSULaxEntities(); }
public PlayerBL(KSULaxEntities entitity) { _entities = entitity; }
public DataBL(KSULaxEntities entitity) { _entities = entitity; }
public AwardBL(KSULaxEntities entitity) { _entities = entitity; }
public NewsController() { _entities = new KSULaxEntities(); _newsBL = new NewsBL(_entities); }
public NationalRankingController() { _entities = new KSULaxEntities(); _dataBL = new DataBL(_entities); _gameBL = new GameBL(_entities); }
public MediaBL(KSULaxEntities entitity) { _entities = entitity; }
public PhotoBL(KSULaxEntities entitity) { _entities = entitity; }
public NewsBL(KSULaxEntities entitity) { _entities = entitity; _gameBL = new GameBL(entitity); }
public HomeController() { _entities = new KSULaxEntities(); _newsBL = new NewsBL(_entities); _gameBL = new GameBL(_entities); }
public MediaController() { _entities = new KSULaxEntities(); _mediaBL = new MediaBL(_entities); }