Ejemplo n.º 1
0
        private void InitMatch()
        {
            DateTime date = DateTime.Now;
            //排除1个月之前的比赛
            var allMatch = EuropeMatchMgr.GetAllMatvch(date.AddDays(-30));
            var allLogo  = ConfigGambleiconMgr.GetAll();

            _logoDic  = allLogo.ToDictionary(r => r.Name.Trim(), r => r.Idx);
            _allMatch = new ConcurrentDictionary <DateTime, List <EuropeMatchEntity> >();
            _oneMatch = new ConcurrentDictionary <int, EuropeMatchEntity>();
            foreach (var item in allMatch)
            {
                item.HomeLogo      = GetLogo(item.HomeName);
                item.AwayLogo      = GetLogo(item.AwayName);
                item.MatchTimeTick = ShareUtil.GetTimeTick(item.MatchTime);
                if (!_allMatch.ContainsKey(item.MatchDate))
                {
                    _allMatch.TryAdd(item.MatchDate, new List <EuropeMatchEntity>());
                }
                _allMatch[item.MatchDate].Add(item);
                _oneMatch.TryAdd(item.MatchId, item);
            }

            //是否有比赛
            _matchInfoDic = new Dictionary <long, bool>();
            for (int i = -7; i <= 7; i++)
            {
                var isMatch = EuropeMatchMgr.GetIsMatch(date.Date.AddDays(i)) > 0;
                _matchInfoDic.Add(ShareUtil.GetTimeTick(date.Date.AddDays(i)), isMatch);
            }
        }
Ejemplo n.º 2
0
        private void InitCache()
        {
            var listGambleIcon = ConfigGambleiconMgr.GetAll();

            _gambleIconDictionary = new Dictionary <string, ConfigGambleiconEntity>();

            foreach (var inner in listGambleIcon)
            {
                if (_gambleIconDictionary.ContainsKey(inner.Name))
                {
                    _gambleIconDictionary[inner.Name] = inner;
                }
                _gambleIconDictionary.Add(inner.Name, inner);
            }
        }