Exemplo n.º 1
0
        /// <summary>
        /// 加载数字彩开奖号码
        /// </summary>
        public static void LoadSZCWinNumber(string gameCode)
        {
            var gameCodeArray = new string[] { "CQSSC", "JX11X5", "SSQ", "DLT", "FC3D", "PL3", "OZB", "SD11X5", "GD11X5", "GDKLSF", "JSKS", "SDKLPK3" };

            if (!gameCodeArray.Contains(gameCode))
            {
                return;
            }

            if (gameCode == "OZB")
            {
                LoadOZBWinNumber();
            }
            else if (gameCode == "SJB")
            {
                LoadSJBWinNumber();
            }
            else
            {
                var lastOpenIssuse = new LotteryGameManager().QueryLastOpenIssuse(gameCode, 100);
                var db             = RedisHelperEx.DB_Match;
                var fullKey        = string.Format("{0}_{1}", gameCode, RedisKeys.Key_MatchResult_List);
                //清空Key对应的value值
                db.Del(fullKey);

                //写入redis库
                //格式:期号^开奖号
                var array = lastOpenIssuse.Select(p => (RedisValue)string.Format("{0}^{1}", p.IssuseNumber, p.WinNumber)).ToArray();
                db.RPush(fullKey, array);
            }
        }
Exemplo n.º 2
0
        //private static GameInfoCollection _gameList = null;
        ///// <summary>
        ///// 所有彩种信息
        ///// </summary>
        //public static GameInfoCollection GameList
        //{
        //    get
        //    {
        //        if (_gameList == null)
        //            _gameList = new GameBusiness().QueryGameInfoCollection();
        //        return _gameList;
        //    }
        //}
        ///// <summary>
        ///// 所有彩种状态
        ///// </summary>
        //public LotteryGameInfoCollection LotteryGame()
        //{
        //    var result = new LotteryGameInfoCollection();
        //    result.AddRange(new DataQuery().QueryLotteryGameList());
        //    return result;
        //}
        ///// <summary>
        ///// 更新彩种状态
        ///// </summary>
        //public void UpdateLotteryGame(string gameCode, int enableStatus)
        //{
        //    var manager = new LotteryGameManager();
        //    var entity = manager.QueryLotteryGame(gameCode);
        //    if (entity == null)
        //        throw new Exception("没有查到该彩种!");
        //    entity.EnableStatus = (EnableStatus)enableStatus;
        //    if (_gameList == null)
        //        _gameList = new GameInfoCollection();
        //    _gameList.Clear();
        //    manager.UpdateLotteryGame(entity);

        //    //清空缓存
        //    BusinessHelper.ReloadLotteryGame();
        //}
        /// <summary>
        /// 返回彩种状态
        /// </summary>
        public EnableStatus LotteryGameToStatus(string gameCode)
        {
            var manager = new LotteryGameManager();
            var entity  = manager.QueryLotteryGame(gameCode);

            if (entity == null)
            {
                throw new Exception("没有查到该彩种!");
            }
            return((EnableStatus)entity.EnableStatus);
        }
Exemplo n.º 3
0
 public static void LoadCurrentIssuseByLocalStopTime(string gameCode)
 {
     var gameCodeArray = new string[] { "CQSSC", "JX11X5", "SSQ", "DLT", "FC3D", "PL3", "SD11X5", "GD11X5", "GDKLSF", "JSKS", "SDKLPK3" };
     if (!gameCodeArray.Contains(gameCode))
         return;
     var db = RedisHelper.DB_CoreCacheData;
     var issuseList = new LotteryGameManager().QueryAllGameCurrentIssuse(false);
     foreach (var item in issuseList)
     {
         string key = string.Format("{0}_ByLocalStopTime_{1}", RedisKeys.Key_CurrentIssuse, item.GameCode);
         var json = JsonHelper.Serialize(item);
         db.StringSetAsync(key, json);
     }
 }
Exemplo n.º 4
0
 public static void LoadNextIssuseListByLocalStopTime(string gameCode)
 {
     var gameCodeArray = new string[] { "CQSSC", "JX11X5", "SSQ", "DLT", "FC3D", "PL3", "SD11X5", "GD11X5", "GDKLSF", "JSKS", "SDKLPK3" };
     if (!gameCodeArray.Contains(gameCode))
         return;
     var db = RedisHelper.DB_CoreCacheData;
     string key = string.Format("{0}_ByLocalStopTime_{1}", RedisKeys.Key_NextIssuse_List, gameCode);
     var issuseList = new LotteryGameManager().QueryNextIssuseList(false, gameCode, 10);
     if (issuseList.Count <= 0)
         return;
     db.KeyDeleteAsync(key);
     foreach (var item in issuseList)
     {
         var json = JsonHelper.Serialize(item);
         db.ListRightPushAsync(key, json);
     }
 }
Exemplo n.º 5
0
        public static void LoadSJBWinNumber()
        {
            var lastOpenIssuse = new LotteryGameManager().QueryLastOpenIssuse("SJB", 2);
            var gjIssuse = lastOpenIssuse.FirstOrDefault(p => p.GameType == "GJ");
            var gyjIssuse = lastOpenIssuse.FirstOrDefault(p => p.GameType == "GYJ");

            var db = RedisHelper.DB_Match;
            var fullKey = string.Format("{0}_{1}", "SJB", RedisKeys.Key_MatchResult_List);
            //清空Key对应的value值
            db.KeyDeleteAsync(fullKey);
            //写入redis库
            //格式:玩法^开奖号
            if (gjIssuse != null && !string.IsNullOrEmpty(gjIssuse.WinNumber))
            {
                var v = string.Format("{0}^{1}", "GJ", gjIssuse.WinNumber);
                db.ListRightPushAsync(fullKey, v);
            }
            if (gyjIssuse != null && !string.IsNullOrEmpty(gyjIssuse.WinNumber))
            {
                var v = string.Format("{0}^{1}", "GYJ", gyjIssuse.WinNumber);
                db.ListRightPushAsync(fullKey, v);
            }
        }