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 { /// /// 分页-基本信息 /// public interface IPageInfo { /// /// 当前页 /// int PageIndex { get; set; } /// /// 每页条数 /// int PageSize { get; set; } /// /// 总记录条数 /// int ItemCount { get; set; } /// /// 是否正在查询 /// bool IsQuery { get; set; } /// /// 分页命令 /// //RelayCommand PagerSearchCommand { get; set; } //PagerSearchCommand.Execute(null); //打开查询默认第一页 #region PagerSearchCommand实例 //public RelayCommand PagerSearchCommand //{ // get // { // return new RelayCommand(() => // { // IsQuery = true; // var pageInfo = new PageInfo(); // pageInfo.PageNumber = this.PageIndex + 1; //服务端从1开始 // pageInfo.RecordPerPage = this.PageSize; // QueryNoticeDataList(pageInfo); // }); // } //} #endregion /// /// 数据控件->数据源 /// List ControlItemsSource { get; set; } //ObservableCollection ControlItemsSource { get; set; } /// /// 成功查询-数据集合 /// /// void QuerySuccess(PageInfo Model); #region QuerySuccess实例 //protected void QuerySuccess(PageInfo 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 /// /// 查询控件数据列表 /// /// void QueryControlDataList(PageInfo pageInfo); #region QueryControlDataList实例 //public void QueryControlDataList(PageInfo pageInfo) //{ // var queryCommonParams = new List(); // 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 } }