码迷,mamicode.com
首页 > 其他好文 > 详细

HighChat动态绑定数据 数据后台绑定(四)

时间:2018-11-17 14:28:14      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:col   register   nbsp   number   ble   直接   max   esc   json   

后台绑定数据,直接返回json数据

IList<SummaryHour> adHourData = summarybll.FindList(str);
                List<int> Hour = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
                List<int> downNumber = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                List<int> RegisterNumber = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                List<int> ClickNumber = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                double max = 1;
                if (adHourData.Count() > 0) {
                    max = adHourData.OrderByDescending(x => x.DownNumber).FirstOrDefault().DownNumber;
                    Hour.Clear(); downNumber.Clear(); RegisterNumber.Clear(); ClickNumber.Clear();
                    foreach (var item in adHourData) {
                        Hour.Add(item.Hour);
                        downNumber.Add(item.DownNumber);
                        RegisterNumber.Add(item.RegisterNumber);
                        ClickNumber.Add(item.ClickNumber);
                    }
                }
                results = new {
                    Hour = Hour,
                    DownNumber = downNumber,
                    RegisterNumber = RegisterNumber,
                    ClickNumber = ClickNumber,
                    max = max,
                    type = 0
                };
                return Json(results);

 

HighChat动态绑定数据 数据后台绑定(四)

标签:col   register   nbsp   number   ble   直接   max   esc   json   

原文地址:https://www.cnblogs.com/elsons/p/9973628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!