Example #1
0
        public override async Task GetPageData(int pageIndex)
        {
            try
            {
                var r = await userService.GetUserListAsync(new Core.Query.UserParameters()
                {
                    PageIndex = PageIndex,
                    PageSize  = PageSize,
                    Search    = SearchText
                });

                if (r != null && r.success)
                {
                    GridModelList = new System.Collections.ObjectModel.ObservableCollection <User>();
                    var pagedList = JsonConvert.DeserializeObject <PagedList <User> >(r.dynamicObj?.ToString());
                    this.TotalCount = pagedList.TotalCount;
                    pagedList.Items?.ToList().ForEach(arg =>
                    {
                        GridModelList.Add(arg);
                    });
                    base.SetPageCount();
                }
            }
            catch (Exception ex)
            {
                //..
            }
        }
        public override async Task GetPageData(int pageIndex)
        {
            try
            {
                SelectPageTitle = "用户管理";
                var r = await userService.GetUserListAsync(new Core.Query.UserParameters()
                {
                    PageIndex = PageIndex,
                    PageSize  = PageSize,
                    Search    = SearchText
                });

                if (r != null && r.success)
                {
                    GridModelList   = new System.Collections.ObjectModel.ObservableCollection <User>();
                    this.TotalCount = r.dynamicObj.TotalCount;
                    r.dynamicObj.Items?.ToList().ForEach(arg =>
                    {
                        GridModelList.Add(arg);
                    });
                    base.SetPageCount();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
            }
        }
Example #3
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        async void GetUserData()
        {
            try
            {
                UpdateLoading(true, "获取用户列表...");
                var r = await service.GetUserListAsync(new UserParameters()
                {
                    PageIndex = 0,
                    PageSize  = 30,
                    Search    = UserSearch
                });

                GridUserModelList = new ObservableCollection <User>();
                if (r.success)
                {
                    r.dynamicObj.Items?.ToList().ForEach(arg =>
                    {
                        GridUserModelList.Add(arg);
                    });
                }
                SelectCardIndex = 1;
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
            }
            finally
            {
                UpdateLoading(false);
            }
        }