Ejemplo n.º 1
0
        private DataGridViewModel <SerachPagesInfo> GetDataList(HttpContext context)
        {
            DataGridViewModel <SerachPagesInfo> dataGridViewModel = new DataGridViewModel <SerachPagesInfo>();
            int num  = 1;
            int num2 = 10;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            int count = (num - 1) * num2;

            this.Pages = WXStoreHelper.GetAllPages();
            this.ConfigurationDevices = WXStoreHelper.GetAllPagesConfigurationDeviceNumber();
            dataGridViewModel.total   = this.Pages.Count;
            dataGridViewModel.rows    = (from c in this.Pages
                                         select new SerachPagesInfo
            {
                page_id = c.page_id,
                comment = c.comment,
                description = c.description,
                icon_url = c.icon_url,
                page_url = c.page_url,
                title = c.title,
                quantity = this.GetDevicesQuantity(c.page_id)
            } into c
                                         orderby c.quantity descending
                                         select c).Skip(count).Take(num2).ToList();
            return(dataGridViewModel);
        }