IPageInfo.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using GalaSoft.MvvmLight.Command;
  2. using Muchinfo.MTPClient.Data;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. namespace Muchinfo.MTPClient.Infrastructure.Interfaces
  9. {
  10. /// <summary>
  11. /// 分页-基本信息
  12. /// </summary>
  13. public interface IPageInfo<T>
  14. {
  15. /// <summary>
  16. /// 当前页
  17. /// </summary>
  18. int PageIndex { get; set; }
  19. /// <summary>
  20. /// 每页条数
  21. /// </summary>
  22. int PageSize { get; set; }
  23. /// <summary>
  24. /// 总记录条数
  25. /// </summary>
  26. int ItemCount { get; set; }
  27. /// <summary>
  28. /// 是否正在查询
  29. /// </summary>
  30. bool IsQuery { get; set; }
  31. /// <summary>
  32. /// 分页命令
  33. /// </summary>
  34. //RelayCommand PagerSearchCommand { get; set; }
  35. //PagerSearchCommand.Execute(null); //打开查询默认第一页
  36. #region PagerSearchCommand实例
  37. //public RelayCommand PagerSearchCommand
  38. //{
  39. // get
  40. // {
  41. // return new RelayCommand(() =>
  42. // {
  43. // IsQuery = true;
  44. // var pageInfo = new PageInfo<object>();
  45. // pageInfo.PageNumber = this.PageIndex + 1; //服务端从1开始
  46. // pageInfo.RecordPerPage = this.PageSize;
  47. // QueryNoticeDataList(pageInfo);
  48. // });
  49. // }
  50. //}
  51. #endregion
  52. /// <summary>
  53. /// 数据控件->数据源
  54. /// </summary>
  55. List<T> ControlItemsSource { get; set; }
  56. //ObservableCollection<T> ControlItemsSource { get; set; }
  57. /// <summary>
  58. /// 成功查询-数据集合
  59. /// </summary>
  60. /// <param name="NoticeMsgs"></param>
  61. void QuerySuccess(PageInfo<T> Model);
  62. #region QuerySuccess实例
  63. //protected void QuerySuccess(PageInfo<NoticeMsg> NoticeMsgs)
  64. //{
  65. // IsQuery = false;
  66. // if (NoticeMsgs != null && NoticeMsgs.QueryResults != null)
  67. // {
  68. // DataGridItemsSource = NoticeMsgs.QueryResults.ToObservableCollection();
  69. // this.ItemCount = NoticeMsgs.TotalCount;
  70. // this.PageIndex = NoticeMsgs.PageNumber - 1; //服务端从1开始
  71. // this.PageSize = NoticeMsgs.RecordPerPage;
  72. // }
  73. //}
  74. #endregion
  75. /// <summary>
  76. /// 查询控件数据列表
  77. /// </summary>
  78. /// <param name="pageInfo"></param>
  79. void QueryControlDataList(PageInfo<object> pageInfo);
  80. #region QueryControlDataList实例
  81. //public void QueryControlDataList(PageInfo<object> pageInfo)
  82. //{
  83. // var queryCommonParams = new List<QueryCommonParam>();
  84. // var accountid = UserManager.CurrentTradeAccount.AccountId;
  85. // if (UserManager.CurrentTradeAccount.FundsAccounts.Any())
  86. // {
  87. // accountid = UserManager.CurrentTradeAccount.FundsAccounts[0].AccountId;
  88. // }
  89. // queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountid + string.Empty });
  90. // _announcementService.QueryNotifyMsg(queryCommonParams, QuerySuccess, QueryErrorCallback, pageInfo);
  91. //}
  92. #endregion
  93. }
  94. }