示例#1
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);
        }
示例#2
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];
        //    }
        //}
        /// <summary>
        /// 传统足球 与 北京单场
        /// </summary>
        /// <returns></returns>
        public static Issuse_QueryInfoEX QueryCurretNewIssuseInfoByList()
        {
            IList <Issuse_QueryInfo> list = new List <Issuse_QueryInfo>();
            Issuse_QueryInfoEX       qex  = new Issuse_QueryInfoEX();

            GameBusiness DQ     = new GameBusiness();
            var          bjlist = DQ.QueryCurrentBJDCIssuseInfo();

            qex.BJDC_IssuseNumber = bjlist.Select(p => new BJDCIssuseInfo
            {
                IssuseNumber      = p.IssuseNumber,
                MinLocalStopTime  = p.MinLocalStopTime.ToString("yyyy-MM-dd HH:mm:ss"),
                MinMatchStartTime = p.MinMatchStartTime.ToString("yyyy-MM-dd HH:mm:ss"),
            }).FirstOrDefault();
            string[] _CTZQType = { "T14C", "T4CJQ", "TR9", "T6BQC" };
            string   gameCode  = "CTZQ";

            foreach (var item in _CTZQType)
            {
                lock (_lckObj_IssuseOffical)
                {
                    var newgamecode = gameCode;
                    if (newgamecode.ToUpper() == "CTZQ")
                    {
                        newgamecode = gameCode + item;
                    }
                    if (!_issuseOficalDictionary.ContainsKey(newgamecode) ||
                        _issuseOficalDictionary[newgamecode] == null ||
                        _issuseOficalDictionary[newgamecode].OfficialStopTime < DateTime.Now)
                    {
                        lock (_lckObj_IssuseOffical2)
                        {
                            _issuseOficalDictionary[newgamecode] = new GameBusiness().QueryCurrentNewIssuseInfo(gameCode, item);
                        }
                    }
                    list.Add(_issuseOficalDictionary[newgamecode]);
                }
            }
            qex.CTZQ_IssuseNumber = list;

            return(qex);
        }
示例#3
0
        public static Issuse_QueryInfo QueryCurretNewIssuseInfo(string gameCode, string gameType)
        {
            var newgamecode = gameCode;

            if (newgamecode.ToUpper() == "CTZQ")
            {
                newgamecode = gameCode + gameType;
            }
            lock (_lckObj_IssuseOffical)
            {
                if (!_issuseOficalDictionary.ContainsKey(newgamecode) ||
                    _issuseOficalDictionary[newgamecode] == null ||
                    _issuseOficalDictionary[newgamecode].OfficialStopTime < DateTime.Now)
                {
                    lock (_lckObj_IssuseOffical2)
                    {
                        _issuseOficalDictionary[newgamecode] = new GameBusiness().QueryCurrentNewIssuseInfo(gameCode, gameType);
                    }
                }
                return(_issuseOficalDictionary[newgamecode]);
            }
        }