Esempio n. 1
0
        private IEnumerable <HandHistory> GetAllHands(HandHistorySchema handHistorySchema)
        {
            connection.Open();

            var sql = string.Format("SELECT chh.id_hand, chh.history FROM {0} chh INNER JOIN {1} chs on chh.id_hand=chs.id_hand where chs.id_site=100", handHistorySchema.HandHistoriesTable, handHistorySchema.HandSummaryTable);

            var command = new NpgsqlCommand(sql, connection);

            var dataReader = command.ExecuteReader();

            var result = new List <HandHistory>();

            while (dataReader.Read())
            {
                var cashHandHistory = new HandHistory
                {
                    Id      = Convert.ToInt32(dataReader["id_hand"]),
                    History = dataReader["history"].ToString()
                };

                result.Add(cashHandHistory);
            }

            connection.Close();

            return(result);
        }
Esempio n. 2
0
        public IEnumerable <HandHistory> GetAllCashHands()
        {
            var handHistorySchema = new HandHistorySchema
            {
                HandHistoriesTable = DbConfiguration.CashHandHistoriesTable,
                HandSummaryTable   = DbConfiguration.CashHandSummaryTable
            };

            var hands = GetAllHands(handHistorySchema);

            return(hands);
        }