Exemple #1
0
        /// <summary>
        /// Selects game player
        /// </summary>
        /// <param name="gameID">The game ID used to filter game player cards</param>
        /// <param name="userId">Current user Id</param>
        /// <returns>A list of game player cards that satisfy the supplied filter</returns>
        public List<Entities.GamePlayerCard> Execute(Int32 gameID, Int32? userId)
        {
            Entities.Filters.GamePlayerCard.Select filter = new Entities.Filters.GamePlayerCard.Select();
            filter.GameID = gameID;
            filter.UserId = userId;

            return _select.Execute(filter);
        }
Exemple #2
0
        /// <summary>
        /// Selects game player
        /// </summary>
        /// <param name="gameID">The game ID used to filter game player cards</param>
        /// <param name="userId">Current user Id</param>
        /// <returns>A list of game player cards that satisfy the supplied filter</returns>
        public List <Entities.GamePlayerCard> Execute(Int32 gameID, Int32?userId)
        {
            Entities.Filters.GamePlayerCard.Select filter = new Entities.Filters.GamePlayerCard.Select();
            filter.GameID = gameID;
            filter.UserId = userId;

            return(_select.Execute(filter));
        }
Exemple #3
0
        /// <summary>
        /// Selects game player cards base on supplied filter
        /// </summary>
        /// <param name="filter">Filter used to select game player cards</param>
        /// <returns>A list of game player cards that satisfy the supplied filter</returns>
        public List <Entities.GamePlayerCard> Execute(Entities.Filters.GamePlayerCard.Select filter)
        {
            List <Entities.GamePlayerCard> playerCards = new List <Entities.GamePlayerCard>();

            using (DbCommand cmd = _db.GetStoredProcCommand("GamePlayerCard_Select"))
            {
                _db.AddInParameter(cmd, "@GameID", DbType.Int32, filter.GameID);

                if (filter.UserId.HasValue)
                {
                    _db.AddInParameter(cmd, "@UserId", DbType.Int32, filter.UserId.Value);
                }

                using (IDataReader idr = _db.ExecuteReader(cmd))
                {
                    while (idr.Read())
                    {
                        playerCards.Add(new Entities.GamePlayerCard(idr));
                    }
                }
            }

            return(playerCards);
        }
Exemple #4
0
 /// <summary>
 /// Selects game player cards base on supplied filter
 /// </summary>
 /// <param name="filter">Filter used to select game player cards</param>
 /// <returns>A list of game player cards that satisfy the supplied filter</returns>
 public List <Entities.GamePlayerCard> Execute(Entities.Filters.GamePlayerCard.Select filter)
 {
     return(_select.Execute(filter));
 }