/// <summary> /// Selects the current round for a game /// </summary> /// <param name="gameID">Filter used to select game rounds</param> /// <param name="selectCards">Select cards for the round</param> /// <returns>The current round</returns> public Entities.GameRound Execute(Int32 gameID, Boolean selectCards) { Entities.Filters.GameRound.SelectCurrent filter = new Entities.Filters.GameRound.SelectCurrent(); filter.GameID = gameID; filter.SelectCards = selectCards; return _selectGameRound.Execute(filter); }
/// <summary> /// Selects the current round for a game /// </summary> /// <param name="gameID">Filter used to select game rounds</param> /// <param name="selectCards">Select cards for the round</param> /// <returns>The current round</returns> public Entities.GameRound Execute(Int32 gameID, Boolean selectCards) { Entities.Filters.GameRound.SelectCurrent filter = new Entities.Filters.GameRound.SelectCurrent(); filter.GameID = gameID; filter.SelectCards = selectCards; return(_selectGameRound.Execute(filter)); }
/// <summary> /// Selects the current round for a game /// </summary> /// <param name="filter">Filter used to select game rounds</param> /// <returns>The current round</returns> public Entities.GameRound Execute(Entities.Filters.GameRound.SelectCurrent filter) { Entities.GameRound round = _selectGameRound.Execute(filter); if (filter.SelectCards && round != null) { round.CardsPlayed = _selectGameRoundCards.Execute(round.GameRoundID); } return(round); }
/// <summary> /// Selects the current round for a game /// </summary> /// <param name="filter">Filter used to select game rounds</param> /// <returns>The current round</returns> public Entities.GameRound Execute(Entities.Filters.GameRound.SelectCurrent filter) { List <Entities.GameRound> gameRounds = new List <Entities.GameRound>(); using (DbCommand cmd = _db.GetStoredProcCommand("GameRound_SelectCurrent")) { _db.AddInParameter(cmd, "@GameID", DbType.Int32, filter.GameID); using (IDataReader idr = _db.ExecuteReader(cmd)) { while (idr.Read()) { gameRounds.Add(new Entities.GameRound(idr)); } } } return(gameRounds.FirstOrDefault()); }