Beispiel #1
0
        public string Get()
        {
            Users users1 = new Users();
            List <highchartsmodel> highchartsmodels = new List <highchartsmodel>();

            highchartsmodel highchartsmodel = new highchartsmodel();
            List <Users>    users           = SQLcmd.SQLcmdData();

            //foreach (var item in users)
            //{
            //    highchartsmodel highchartsmodel1 = new highchartsmodel()
            //    {
            //        data = new List<int>()
            //    };
            //    highchartsmodel1.name = item.Name.ToString();
            //    highchartsmodel1.data.Add(item.January);
            //    highchartsmodel1.data.Add(item.February);
            //    highchartsmodel1.data.Add(item.March);
            //    highchartsmodels.Add(highchartsmodel1);
            //}

            String hingeString = Newtonsoft.Json.JsonConvert.SerializeObject(users);

            return(hingeString);
        }
Beispiel #2
0
        /// <summary>
        /// 根据国家ID查询数据
        /// </summary>
        /// <param name="id">国家ID</param>
        /// <returns>国家所有月份的值</returns>
        public string GetMonthDatagetByCountryId(int id)
        {
            Users users1 = new Users();
            List <highchartsmodel> highchartsmodels = new List <highchartsmodel>();
            highchartsmodel        highchartsmodel  = new highchartsmodel();
            List <Users>           users            = SQLcmd.SQLcmdData(id);
            String hingeString = Newtonsoft.Json.JsonConvert.SerializeObject(users);

            return(hingeString);
        }
Beispiel #3
0
        public string GetSearchHighcharts(string name)
        {
            Users users1 = new Users();
            List <highchartsmodel> highchartsmodels = new List <highchartsmodel>();
            List <Users>           users            = SQLcmd.SQLcmdSearch(name);

            foreach (var item in users)
            {
                highchartsmodel highchartsmodel1 = new highchartsmodel()
                {
                    data = new List <int>()
                };
                highchartsmodel1.name = item.Name.ToString();
                highchartsmodel1.data.Add(item.January);
                highchartsmodel1.data.Add(item.February);
                highchartsmodel1.data.Add(item.March);
                highchartsmodels.Add(highchartsmodel1);
            }

            String hingeString = Newtonsoft.Json.JsonConvert.SerializeObject(highchartsmodels);

            return(hingeString);
        }