| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using GalaSoft.MvvmLight.Command;
- using Muchinfo.MTPClient.Data;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- namespace Muchinfo.MTPClient.Infrastructure.Interfaces
- {
- /// <summary>
- /// 分页-基本信息
- /// </summary>
- public interface IPageInfo<T>
- {
- /// <summary>
- /// 当前页
- /// </summary>
- int PageIndex { get; set; }
- /// <summary>
- /// 每页条数
- /// </summary>
- int PageSize { get; set; }
- /// <summary>
- /// 总记录条数
- /// </summary>
- int ItemCount { get; set; }
- /// <summary>
- /// 是否正在查询
- /// </summary>
- bool IsQuery { get; set; }
- /// <summary>
- /// 分页命令
- /// </summary>
- //RelayCommand PagerSearchCommand { get; set; }
- //PagerSearchCommand.Execute(null); //打开查询默认第一页
- #region PagerSearchCommand实例
- //public RelayCommand PagerSearchCommand
- //{
- // get
- // {
- // return new RelayCommand(() =>
- // {
- // IsQuery = true;
- // var pageInfo = new PageInfo<object>();
- // pageInfo.PageNumber = this.PageIndex + 1; //服务端从1开始
- // pageInfo.RecordPerPage = this.PageSize;
- // QueryNoticeDataList(pageInfo);
- // });
- // }
- //}
- #endregion
- /// <summary>
- /// 数据控件->数据源
- /// </summary>
- List<T> ControlItemsSource { get; set; }
- //ObservableCollection<T> ControlItemsSource { get; set; }
- /// <summary>
- /// 成功查询-数据集合
- /// </summary>
- /// <param name="NoticeMsgs"></param>
- void QuerySuccess(PageInfo<T> Model);
- #region QuerySuccess实例
- //protected void QuerySuccess(PageInfo<NoticeMsg> NoticeMsgs)
- //{
- // IsQuery = false;
- // if (NoticeMsgs != null && NoticeMsgs.QueryResults != null)
- // {
- // DataGridItemsSource = NoticeMsgs.QueryResults.ToObservableCollection();
- // this.ItemCount = NoticeMsgs.TotalCount;
- // this.PageIndex = NoticeMsgs.PageNumber - 1; //服务端从1开始
- // this.PageSize = NoticeMsgs.RecordPerPage;
- // }
- //}
- #endregion
- /// <summary>
- /// 查询控件数据列表
- /// </summary>
- /// <param name="pageInfo"></param>
- void QueryControlDataList(PageInfo<object> pageInfo);
- #region QueryControlDataList实例
- //public void QueryControlDataList(PageInfo<object> pageInfo)
- //{
- // var queryCommonParams = new List<QueryCommonParam>();
- // var accountid = UserManager.CurrentTradeAccount.AccountId;
- // if (UserManager.CurrentTradeAccount.FundsAccounts.Any())
- // {
- // accountid = UserManager.CurrentTradeAccount.FundsAccounts[0].AccountId;
- // }
- // queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountid + string.Empty });
- // _announcementService.QueryNotifyMsg(queryCommonParams, QuerySuccess, QueryErrorCallback, pageInfo);
- //}
- #endregion
- }
- }
|