protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.AllStatistics = WXStoreHelper.GetAllStatistics();
         this.Devices       = WXStoreHelper.GetAllDevices();
         this.AllStores     = WXStoreHelper.GetAllPoiList();
     }
 }
Beispiel #2
0
        private DataGridViewModel <WXStoreHelper.SearchStatistics> GetDataList(HttpContext context)
        {
            DataGridViewModel <WXStoreHelper.SearchStatistics> dataGridViewModel = new DataGridViewModel <WXStoreHelper.SearchStatistics>();
            string calendarDate = string.Empty;
            string empty        = string.Empty;

            empty = context.Request["calendarDate"];
            if (!string.IsNullOrEmpty(empty))
            {
                calendarDate = empty;
            }
            List <WXStoreHelper.DataItemForDate> list = this.AllStatistics;

            if (calendarDate.ToDateTime() >= (DateTime?)DateTime.Now.Date)
            {
                throw new HidistroAshxException("请选择小于当天的日期");
            }
            this.AllStatistics = WXStoreHelper.GetAllStatistics();
            this.Devices       = WXStoreHelper.GetAllDevices();
            this.AllStores     = WXStoreHelper.GetAllPoiList();
            if (!string.IsNullOrEmpty(calendarDate))
            {
                list = (from c in list
                        where c.CurrentDate == calendarDate
                        select c).ToList();
            }
            if (list != null)
            {
                dataGridViewModel.total = list.Count;
                int count = (base.CurrentPageIndex - 1) * base.CurrentPageSize;
                list = list.Skip(count).Take(base.CurrentPageSize).ToList();
                dataGridViewModel.rows = (from c in list
                                          select new WXStoreHelper.SearchStatistics
                {
                    device_id = c.device_id,
                    shake_pv = c.shake_pv,
                    shake_uv = c.shake_uv,
                    click_pv = c.click_pv,
                    click_uv = c.click_uv,
                    StoreName = this.GetStoreName(c.device_id),
                    Remark = this.GetRemark(c.device_id),
                    CurrentDate = c.CurrentDate
                }).ToList();
            }
            return(dataGridViewModel);
        }