paging Logic processing class PageCollection.cs
1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 6 namespaceCommon7{8 /// <summary>9 ///paging Logical Processing classTen /// </summary> One Public classPagecollection A{ - /// <summary> - ///Total Pages the /// </summary> - Public intTotalPages {Get;Set; } - /// <summary> - ///Current Page + /// </summary> - Public intcurrentpage {Get;Set; } + /// <summary> A ///number of records per page at /// </summary> - Public intonepagesize {Get;Set; } - /// <summary> - ///Total Record Count - /// </summary> - Public Longtotalrows {Get;Set; } in /// <summary> - ///Sort to /// </summary> + Public string{Get;Set; } - the /// <summary> * ///constructs no parameter defaults to the maximum number $ /// </summary>Panax Notoginseng PublicPagecollection () -{ the This. CurrentPage =0; + This. Onepagesize = -;//default maximum number of rows 20 bar A} the} + /// <summary> - ///paging logical Processing Class LINQ to Entites $ /// </summary> $ Public classPageinfo<tentity>whereTEntity:class -{ - PublicPageInfo (intIndexintPageSize,intCount, List<tentity> List,stringUrl="") the{ -index = index;WuyiPageSize = PageSize; theCount = Count; -list = list; Wuurl = URL; - //calculates the value of the number of data bars from start to end About if(Count = =0) ${ -Beginpage =0; -EndPage =0; -} A Else +{ the intMaxpage = count/pagesize; - $ if(Count% PageSize >0) the{ themaxpage++; the} the if(Index >= Maxpage) -{ inindex = maxpage; the theBeginpage = pageSize * index-pagesize +1; AboutEndPage = count; the} the Else the{ +Beginpage = pageSize * index-pagesize +1; -EndPage = pageSize * INDEX; the}Bayi} the} the - Public intIndex {Get;Private Set; } - Public intPageSize {Get;Private Set; } the Public intCount {Get;Private Set; } the PublicList<tentity> List {Get;Set; } the Public stringURL {Get;Set; } the Public intBeginpage {Get;Private Set; } - Public intEndPage {Get;Private Set; } the} the the /// <summary>94 ///paging Logical processing class dynamic the /// </summary> the Public classPageInfo the{98 PublicPageInfo (intIndexintPageSize,intCountDynamicListstringURL ="") About{ -index = index;101PageSize = PageSize;102Count = Count;103list = list;104url = URL; the //calculates the value of the number of data bars from start to end106 if(Count = =0)107{108Beginpage =0;109EndPage =0; the}111 Else the{113 intMaxpage = count/pagesize; the the if(Count% PageSize >0) the{117maxpage++;118}119 if(Index >= Maxpage) -{121index = maxpage;122 123Beginpage = pageSize * index-pagesize +1;124EndPage = count; the}126 Else127{ -Beginpage = pageSize * index-pagesize +1;129EndPage = pageSize * INDEX; the}131} the}133 134 Public intIndex {Get;Private Set; }135 Public intPageSize {Get;Private Set; }136 Public intCount {Get;Private Set; }137 Public DynamicList {Get;Private Set; }138 Public stringURL {Get;Set; }139 Public intBeginpage {Get;Private Set; } $ Public intEndPage {Get;Private Set; }141}142 143 /// <summary>144 ///Eazyui page processing logic classes145 /// </summary>146 Public classPageeazyui147{148 PublicPageeazyui (int_page,int_pagesize,int_total,Object_rows)149{ Maxpage = _page;151pagesize = _pagesize; theTotal = _total;153rows = _rows;154}155 156 Public intPage {Get;Private Set; }157 Public intpagesize {Get;Private Set; }158 Public intTotal {Get;Private Set; }159 Public ObjectRows {Get;Private Set; } the}161}
C # Public helper class pagination logical processing class