Ejemplo n.º 1
0
        private void RetrieveGraphedOdds(Stack <OddsInfo> oddsInfos)
        {
            Dictionary <int, OddsInfo> dictionary = new Dictionary <int, OddsInfo>();
            List <int> list = new List <int>();

            while (oddsInfos.Count > 0)
            {
                OddsInfo oddsInfo1 = oddsInfos.Pop();
                if (!dictionary.ContainsKey(oddsInfo1.CompanyId))
                {
                    dictionary.Add(oddsInfo1.CompanyId, oddsInfo1);
                }
                else
                {
                    dictionary[oddsInfo1.CompanyId] = oddsInfo1;
                }
                if (oddsInfos.Count > 0)
                {
                    OddsInfo oddsInfo2 = oddsInfos.Peek();
                    if (oddsInfo1.CompanyId != oddsInfo2.CompanyId && !list.Contains(oddsInfo1.CompanyId))
                    {
                        list.Add(oddsInfo1.CompanyId);
                    }
                    if (!(oddsInfo1.UpdateTime == oddsInfo2.UpdateTime) && list.Count > 10)
                    {
                        this.Calculate(oddsInfo1.UpdateTime, (IEnumerable <OddsInfo>)dictionary.Values);
                        list.Clear();
                    }
                }
                else
                {
                    this.Calculate(oddsInfo1.UpdateTime, (IEnumerable <OddsInfo>)dictionary.Values);
                }
            }
        }
Ejemplo n.º 2
0
        public Stack <OddsInfo> GetOddsInfo(string sql)
        {
            Stack <OddsInfo> stack = new Stack <OddsInfo>();

            using (IDataReader reader = (IDataReader)this._helper.ExecuteReader(CommandType.Text, sql, new SqlParameter[0]))
            {
                while (reader.Read())
                {
                    OddsInfo oddsInfo = this.RetrieveOddsInfo(reader);
                    stack.Push(oddsInfo);
                }
                return(stack);
            }
        }