コード例 #1
0
        public List <SessionInfo> GetAHandfullOfLastSessions()
        {
            string sql =
                @"select s.[Time], s.WorkerId, s.DollarsPerBar, g.totalProfit, g.gamesPlayed from sessions s
                    inner join 
                        (select Games.SessionId, sum(Games.TurksProfit) as totalProfit, count(Id) as gamesPlayed 
                        from games 
                        where games.TurksProfit is not null  
                        group by Games.SessionId) g
                    on s.Id = g.SessionId
                    order by s.Id desc";

            return(_db.LoadDataList <SessionInfo, dynamic>(sql, new { }));
        }
コード例 #2
0
        public List <MovesWithGames> GetMovesWithGames(DateTime startTime, DateTime endTime)
        {
            FixDefaults(ref startTime, ref endTime);
            string sql = @"Select g.*, s.WorkerId, m.ProposedAmount, m.MoveBy  
                                from Sessions s
                                join games g on g.SessionId = s.Id
                                join moves m on m.GameId = g.Id
                                where WorkerId like 'A%' and 
                                    g.StartTime >= @StartTime and 
                                    g.EndTime <= @EndTime
                                order by g.Id desc, m.Id";


            return(_db.LoadDataList <MovesWithGames, dynamic>(sql, new { EndTime = endTime, StartTime = startTime }));
        }
コード例 #3
0
        public List <GameParametersModel> GetAllParameters()
        {
            string sql = @"select * from dbo.GameParameters order by Id desc";

            return(_db.LoadDataList <GameParametersModel, dynamic>(sql, new { }));
        }
コード例 #4
0
        public List <SettingModel> GetAllSettings()
        {
            string sql = @"select * from dbo.Settings order by [Key]";

            return(_db.LoadDataList <SettingModel, dynamic>(sql, new { }));
        }