Ejemplo n.º 1
0
        private List <DeviceSearch_Data_Devices> DevicesInPage(long page_id)
        {
            List <DeviceSearch_Data_Devices> list = new List <DeviceSearch_Data_Devices>();
            int num  = 0;
            int num2 = 50;
            SearchPageResultJson searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(page_id, num, num2);

            while (searchPageResultJson.data.relations.Count > 0)
            {
                num += num2;
                list.AddRange(searchPageResultJson.data.relations);
                searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(page_id, num, num2);
            }
            return(list);
        }
Ejemplo n.º 2
0
        private DataGridViewModel <SearchDevices> GetDataList(HttpContext context)
        {
            DataGridViewModel <SearchDevices> dataGridViewModel = new DataGridViewModel <SearchDevices>();
            int  num  = 1;
            int  num2 = 10;
            long num3 = 0L;

            num = base.GetIntParam(context, "page", false).Value;
            if (num < 1)
            {
                num = 1;
            }
            num2 = base.GetIntParam(context, "rows", false).Value;
            if (num2 < 1)
            {
                num2 = 10;
            }
            num3           = context.Request["page_id"].ToLong(0);
            this.AllStores = WXStoreHelper.GetAllPoiList();
            this.Devices   = (from c in WXStoreHelper.GetAllDevices()
                              orderby c.status descending
                              select c).ToList();
            this.ConfigurationPages = WXStoreHelper.GetAllDevicesConfigurationPageNumber();
            int begin = (num - 1) * num2;
            SearchPageResultJson searchPageResultJson = WXStoreHelper.SearchDevicesByPageId(num3, begin, num2);

            if (searchPageResultJson.errcode.Equals(ReturnCode.请求成功))
            {
                dataGridViewModel.rows = (from c in searchPageResultJson.data.relations
                                          select new SearchDevices
                {
                    device_id = c.device_id,
                    StoreName = this.SetStoreName(c.device_id),
                    Remark = c.comment,
                    EquipmentExistsNumber = this.SetConfigurationPageNumber(c.device_id)
                }).ToList();
                dataGridViewModel.total = searchPageResultJson.data.total_count;
            }
            return(dataGridViewModel);
        }