/// <summary> /// Get an existing set of extras if it exists or an empty one if not yet created /// </summary> /// <param name="MatchID">The Match ID</param> /// <param name="Us">For them or us?</param> public Extras(int MatchID, ThemOrUs Who) { _who = Who; Dao myDao = new Dao(); _data = myDao.GetExtras(MatchID, Who); }
/// <summary> /// Create a new set of bowling stats /// </summary> /// <param name="MatchID">The id of the match</param> /// <param name="Us">is this for us (true), or for the opposition (false)</param> internal BowlingStats(int MatchID, ThemOrUs who) { Dao myDAO = new Dao(); BowlingStatsData = (from a in myDAO.GetBowlingStats(MatchID, who) select new BowlingStatsLine(a)).ToList(); Who = who; }
public FoWStats(int MatchID, ThemOrUs who) { Who = who; Dao myDAO = new Dao(); Data = (from a in myDAO.GetFoWData(MatchID, who) select new FoWStatsLine(a)).ToList(); }
/// <summary> /// Get a batting scorecard for a game /// </summary> /// <param name="matchId">The id of the match to fetch the scorecard for</param> /// <param name="themOrUs">Do you want the website team's batting or the opposition's</param> public BattingCard(int matchId, ThemOrUs themOrUs) { Dao dao = new Dao(); ScorecardData = (dao.GetBattingCard(matchId, themOrUs).Where(a => a.PlayerID != -1).Where( a => a.PlayerName != "(Frank) Extras").Select(a => new BattingCardLine(a))).OrderBy(b => b.BattingAt).ToList(); MatchId = matchId; try { if (ThemOrUs.Us == themOrUs) { Extras = dao.GetBattingCard(matchId, themOrUs).Where(a => a.PlayerID == -1).FirstOrDefault().Score; } else { this.Extras = dao.GetBattingCard(matchId, themOrUs).Where(a => a.ModeOfDismissal == -1).FirstOrDefault().Score; } } catch { this.Extras = 0; } }