public CTZQMatch_PoolInfo_Collection QueryCTZQMatch_PoolCollection(string gameType, string issuseNumber) { // Session.Clear(); CTZQMatch_PoolInfo_Collection collection = new CTZQMatch_PoolInfo_Collection(); collection.TotalCount = 0; var query = (from s in this.DB.CreateQuery <C_CTZQ_Match>() //join g in Session.Query<GameIssuse>() on s.IssuseNumber equals g.IssuseNumber where s.GameType == gameType && s.GameCode == "CTZQ" && s.IssuseNumber == issuseNumber orderby s.OrderNumber ascending select s).ToList().Select(s => new CTZQMatch_PoolInfo { GameCode = s.GameCode, GameType = s.GameType, GuestTeamHalfScore = s.GuestTeamHalfScore, GuestTeamId = s.GuestTeamId, GuestTeamName = s.GuestTeamName, GuestTeamScore = s.GuestTeamScore, GuestTeamStanding = s.GuestTeamStanding + "", HomeTeamHalfScore = s.HomeTeamHalfScore, HomeTeamId = s.HomeTeamId, HomeTeamName = s.HomeTeamName, HomeTeamScore = s.HomeTeamScore, HomeTeamStanding = s.HomeTeamStanding + "", Id = s.Id, IssuseNumber = s.IssuseNumber, MatchId = s.MatchId, MatchName = s.MatchName, MatchResult = s.MatchResult == null ? "" : s.MatchResult, MatchStartTime = s.MatchStartTime, Mid = s.Mid, OrderNumber = s.OrderNumber, UpdateTime = s.UpdateTime, BounsTime = s.UpdateTime, }); if (query != null) { collection.ListInfo.AddRange(query.ToList()); collection.TotalCount = query.ToList().Count; } return(collection); }
public CTZQMatch_PoolInfo_Collection GetCTZQIssuse(string gameType, int count) { CTZQMatch_PoolInfo_Collection collection = new CTZQMatch_PoolInfo_Collection(); var query = from s in Session.Query <CTZQ_Match>() where s.GameType == gameType group s by s.IssuseNumber into g select new CTZQMatch_PoolInfo { IssuseNumber = g.Key, }; if (query != null && query.Count() > 0) { collection.ListInfo = query.ToList().OrderByDescending(s => s.IssuseNumber).Take(count).ToList(); return(collection); } return(new CTZQMatch_PoolInfo_Collection()); }