Ejemplo n.º 1
0
        ///// <summary>
        ///// 以官方结束时间为准 获取当前奖期信息
        ///// </summary>
        //public static Issuse_QueryInfo GetCurrentIssuseInfoWithOffical(string gameCode)
        //{
        //    lock (_lckObj_IssuseOffical)
        //    {
        //        if (!_issuseOficalDictionary.ContainsKey(gameCode)
        //            || _issuseOficalDictionary[gameCode] == null
        //            || _issuseOficalDictionary[gameCode].OfficialStopTime < DateTime.Now)
        //        {
        //            lock (_lckObj_IssuseOffical2)
        //            {
        //                _issuseOficalDictionary[gameCode] = new GameBusiness().QueryCurrentIssuseInfoWithOffical(gameCode);
        //            }
        //        }
        //        return _issuseOficalDictionary[gameCode];
        //    }
        //}

        public static Issuse_QueryInfo QueryCurretNewIssuseInfo(string gameCode, string gameType)
        {
            lock (_lckObj_IssuseOffical)
            {
                if (!_issuseOficalDictionary.ContainsKey(gameCode) ||
                    _issuseOficalDictionary[gameCode] == null ||
                    _issuseOficalDictionary[gameCode].OfficialStopTime < DateTime.Now)
                {
                    lock (_lckObj_IssuseOffical2)
                    {
                        _issuseOficalDictionary[gameCode] = new GameBusiness().QueryCurrentNewIssuseInfo(gameCode, gameType);
                    }
                }
                return(_issuseOficalDictionary[gameCode]);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取当前奖期信息
        /// </summary>
        public static Issuse_QueryInfo GetCurrentIssuserInfo(string gameCode)
        {
            if (_issuseDictionary.Keys.Contains(gameCode))
            {
                var existIssuse = _issuseDictionary.FirstOrDefault(d => d.Key == gameCode);
                if (existIssuse.Value != null && existIssuse.Value.LocalStopTime > DateTime.Now)
                {
                    return(existIssuse.Value);
                }
            }

            var issuse = new GameBusiness().QueryCurrentIssuseInfo(gameCode);

            _issuseDictionary.Remove(gameCode);
            _issuseDictionary.Add(gameCode, issuse);
            return(issuse);
        }