Esempio n. 1
0
        public HighChart ParseToHighChart(IOrderedEnumerable <ScoreList> source)
        {
            var hiChart = new HighChart();

            if (source.Any())
            {
                hiChart.Name = source.First().Title;
                hiChart.Data = source.Select(s => ParseDateAndNumber(s.Date, s.Popular)).ToList();
            }
            return(hiChart);
        }
Esempio n. 2
0
        public HighChart[] BahaGetOneGame(string game, string startDate, string endDate)
        {
            var gameList  = game.Split(',');
            var chartList = new HighChart[gameList.Length];
            var client    = ThriftTool.GetClient("default", ref _transport);

            for (var i = 0; i < gameList.Length; i++)
            {
                var       rank      = new List <ScoreList>();
                CqlResult cqlResult = client.execute_cql_query(ThriftTool.ToByte("select * from BahamutGames where Title='" + gameList[i] + "'"), Compression.NONE);

                foreach (CqlRow t in cqlResult.Rows)
                {
                    var rl = new ScoreList();
                    foreach (var col in t.Columns)
                    {
                        var name = ThriftTool.ToString(col.Name);
                        switch (name)
                        {
                        case "Title":
                            rl.Title = ThriftTool.ToString(col.Value);
                            break;

                        case "Link":
                            rl.Link = ThriftTool.ToString(col.Value);
                            break;

                        case "Article":
                            rl.Article = ThriftTool.ToString(col.Value);
                            break;

                        case "Popular":
                            rl.Popular = ThriftTool.ToString(col.Value);
                            break;

                        case "Date":
                            rl.Date = ThriftTool.ToInt(col.Value);
                            break;
                        }
                    }
                    rank.Add(rl);
                }

                var ranks = from n in rank orderby n.Date select n;

                chartList[i] = ParseToHighChart(ranks);
            }
            ThriftTool.TransportClose(ref _transport);

            return(chartList);
        }
Esempio n. 3
0
 public HighChart ParseToHighChart(IOrderedEnumerable<ScoreList> source)
 {
     var hiChart = new HighChart();
     if(source.Any())
     {
         hiChart.Name = source.First().Title;
         hiChart.Data = source.Select(s => ParseDateAndNumber(s.Date, s.Popular)).ToList();
     }
     return hiChart;
 }
Esempio n. 4
0
        public HighChart[] BahaGetOneGame(string game, string startDate, string endDate)
        {
            
            var gameList = game.Split(',');
            var chartList = new HighChart[gameList.Length];
            var client = ThriftTool.GetClient("default", ref _transport);

            for(var i=0;i<gameList.Length;i++)
            {
                var rank = new List<ScoreList>();
                CqlResult cqlResult = client.execute_cql_query(ThriftTool.ToByte("select * from BahamutGames where Title='" + gameList[i] + "'"), Compression.NONE);

                foreach (CqlRow t in cqlResult.Rows)
                {
                    var rl = new ScoreList();
                    foreach (var col in t.Columns)
                    {
                        var name = ThriftTool.ToString(col.Name);
                        switch (name)
                        {
                            case "Title":
                                rl.Title = ThriftTool.ToString(col.Value);
                                break;
                            case "Link":
                                rl.Link = ThriftTool.ToString(col.Value);
                                break;
                            case "Article":
                                rl.Article = ThriftTool.ToString(col.Value);
                                break;
                            case "Popular":
                                rl.Popular = ThriftTool.ToString(col.Value);
                                break;
                            case "Date":
                                rl.Date = ThriftTool.ToInt(col.Value);
                                break;
                        }
                    }
                    rank.Add(rl);
                }
                
                var ranks = from n in rank orderby n.Date select n;

                chartList[i] = ParseToHighChart(ranks);
            }
            ThriftTool.TransportClose(ref _transport);

            return chartList;
        }