Exemple #1
0
        /// <summary>
        /// 获取全部数据的方法
        /// </summary>
        /// <param name="page">设置 查询第几页和一页好多数据</param>
        /// <returns></returns>
        public async Task <PageInfo <Contacts> > GetData(Page page)
        {
            var contact = Db.Query <Contacts>("Select * from hnInfo");
            await Task.Delay(10);

            var pageContact = PageInfo <Contacts> .Create(contact, page.PageNumber, page.PageSize);

            //if (pageContact.Count == 0)return new ResultDTO(200, "获取失败", pageContact, ResultStatus.Fail);
            //return new ResultDTO(200, "获取成功", pageContact, ResultStatus.Suceess);
            return(pageContact);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}

            MainMenu = new ObservableCollection <MenuItem>();

            // Initialise the JsonMenu
            MainMenu.Add(new MenuItem("json", new List <PageInfo>()
            {
                PageInfo.Create <JsonGet>("get")
            }));
        }
Exemple #3
0
 public PageInfo <UserDto> GetRange(int page, int pageSize, UserFilter filter)
 {
     var(items, count) = _userRepository.GetRange(page, pageSize, filter);
     return(PageInfo <UserDto> .Create(page, pageSize, items.Select(Mapper.Map <UserDto>).ToList(), count));
 }