市长热线演示版

Pagination.cs 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using System.Data.SqlClient;
  7. namespace HySoft.DBUtility
  8. {
  9. /// <summary>
  10. /// 信息分页 张国杰
  11. /// Edition 1.1
  12. /// </summary>
  13. public class Pagination
  14. {
  15. private string pageBar = ""; //分页功能条
  16. private int pageBarSize = 1; //分页功能条页码数
  17. private string urlStr = ""; //分页链接字符串
  18. private int pageSize = 0; //每页显示记录的数量
  19. private int recordCount = 0; //记录总数
  20. private int sequence = 0; //当前页次
  21. private string searchField = ""; //查询字段
  22. private string searchSentence = ""; //查询语句
  23. private string sortSentence = ""; //排序语句
  24. private string primarykey = ""; //主键
  25. private string tableName = ""; //要查询表的名称
  26. private string itemUnit = ""; //单位
  27. private string imagesPath = ""; //分页功能条按钮图片存放地址 如: "../_imgs/"
  28. #region 属性
  29. /// <summary>
  30. /// 分页功能条
  31. /// </summary>
  32. public string PageBar
  33. {
  34. get { return pageBar; }
  35. set { pageBar = value; }
  36. }
  37. /// <summary>
  38. /// 分页功能条
  39. /// </summary>
  40. public int PageBarSize
  41. {
  42. get { return pageBarSize; }
  43. set { pageBarSize = value; }
  44. }
  45. /// <summary>
  46. /// 分页链接字符串,例 "default.aspx?id=3&cid=4"
  47. /// </summary>
  48. public string UrlStr
  49. {
  50. get { return urlStr; }
  51. set { urlStr = value; }
  52. }
  53. /// <summary>
  54. /// 每页显示记录的数量
  55. /// </summary>
  56. public int PageSize
  57. {
  58. get { return pageSize; }
  59. set { pageSize = value; }
  60. }
  61. /// <summary>
  62. /// 记录总数
  63. /// </summary>
  64. public int RecordCount
  65. {
  66. get { return recordCount; }
  67. set { recordCount = value; }
  68. }
  69. /// <summary>
  70. /// 当前页次/页码
  71. /// </summary>
  72. public int Sequence
  73. {
  74. get
  75. {
  76. return (sequence != 0) ? sequence : 1;
  77. }
  78. set
  79. { sequence = value; }
  80. }
  81. /// <summary>
  82. /// 查询语句,例: "AND Keywords = '' AND ID = 2"
  83. /// </summary>
  84. public string SearchSentence
  85. {
  86. get { return searchSentence; }
  87. set { searchSentence = value; }
  88. }
  89. /// <summary>
  90. /// 排序语句,例: " ORDER BY MCardID DESC"
  91. /// </summary>
  92. public string SortSentence
  93. {
  94. get { return sortSentence; }
  95. set { sortSentence = value; }
  96. }
  97. /// <summary>
  98. /// 查询主体表的主键
  99. /// </summary>
  100. public string Primarykey
  101. {
  102. get { return primarykey; }
  103. set { primarykey = value; }
  104. }
  105. /// <summary>
  106. /// 查询主体表,例: "News"
  107. /// </summary>
  108. public string TableName
  109. {
  110. get { return tableName; }
  111. set { tableName = value; }
  112. }
  113. /// <summary>
  114. /// 查询字段,例: "*" 或者 "UserName,UserPassword,RealName,..."
  115. /// </summary>
  116. public string SearchField
  117. {
  118. get { return searchField; }
  119. set { searchField = value; }
  120. }
  121. /// <summary>
  122. /// 记录的单位名称,例:"条记录" 或 "件商品"
  123. /// </summary>
  124. public string ItemUnit
  125. {
  126. get { return itemUnit; }
  127. set { itemUnit = value; }
  128. }
  129. /// <summary>
  130. /// 分页功能条按钮图片存放地址 如: "../Images/"
  131. /// </summary>
  132. public string ImagesPath
  133. {
  134. get { return (string.IsNullOrEmpty(imagesPath)) ? "../Images/" : imagesPath; }
  135. set { imagesPath = value; }
  136. }
  137. #endregion
  138. #region 方法
  139. /// <summary>
  140. /// 匹配当前页次、查询条件、排序语句等参数,获取数据表
  141. /// </summary>
  142. /// <returns></returns>
  143. public DataTable GetDataTable()
  144. {
  145. SqlParameter[] parms = new SqlParameter[]
  146. {
  147. new SqlParameter("@SqlWhere", SqlDbType.VarChar,8000),
  148. new SqlParameter("@PageSize", SqlDbType.Int),
  149. new SqlParameter("@PageIndex", SqlDbType.Int),
  150. new SqlParameter("@SqlTable", SqlDbType.VarChar,8000),
  151. new SqlParameter("@SqlField", SqlDbType.VarChar,8000),
  152. new SqlParameter("@SqlPK", SqlDbType.VarChar,50),
  153. new SqlParameter("@SqlOrder", SqlDbType.VarChar,200),
  154. new SqlParameter("@Count", SqlDbType.Int),
  155. };
  156. parms[0].Value = searchSentence;
  157. parms[1].Value = pageSize;
  158. parms[2].Value = sequence;
  159. parms[3].Value = tableName;
  160. parms[4].Value = searchField;
  161. parms[5].Value = primarykey;
  162. parms[6].Value = sortSentence;
  163. parms[7].Direction = ParameterDirection.Output;
  164. DataTable dt = new DataTable(); ;
  165. using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
  166. {
  167. dt = DbHelperSQL.ExecuteDataTable(conn, CommandType.StoredProcedure, "PaginationData", parms);
  168. RecordCount = int.Parse((parms[7].Value.ToString()));
  169. conn.Close();
  170. conn.Dispose();
  171. }
  172. return dt;
  173. }
  174. /// <summary>
  175. /// 匹配当前页次、查询条件、排序语句等参数,获取数据表
  176. /// </summary>
  177. /// <returns></returns>
  178. public DataTable GetDataTables()
  179. {
  180. SqlParameter[] parms = new SqlParameter[]
  181. {
  182. new SqlParameter("@SqlWhere", SqlDbType.VarChar,8000),
  183. new SqlParameter("@PageSize", SqlDbType.Int),
  184. new SqlParameter("@PageIndex", SqlDbType.Int),
  185. new SqlParameter("@SqlTable", SqlDbType.VarChar,8000),
  186. new SqlParameter("@SqlField", SqlDbType.VarChar,8000),
  187. new SqlParameter("@SqlPK", SqlDbType.VarChar,50),
  188. new SqlParameter("@SqlOrder", SqlDbType.VarChar,200),
  189. new SqlParameter("@Count", SqlDbType.Int),
  190. };
  191. parms[0].Value = searchSentence;
  192. parms[1].Value = pageSize;
  193. parms[2].Value = sequence;
  194. parms[3].Value = tableName;
  195. parms[4].Value = searchField;
  196. parms[5].Value = primarykey;
  197. parms[6].Value = sortSentence;
  198. parms[7].Direction = ParameterDirection.Output;
  199. DataTable dt = new DataTable();
  200. using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
  201. {
  202. dt = DbHelperSQL.ExecuteDataTable(conn, CommandType.StoredProcedure, "PaginationData", parms);
  203. RecordCount = int.Parse((parms[7].Value.ToString()));
  204. conn.Close();
  205. conn.Dispose();
  206. }
  207. return dt;
  208. }
  209. /// <summary>
  210. /// 匹配当前页次、查询条件、排序语句等参数,获取数据表
  211. /// </summary>
  212. /// <returns></returns>
  213. public DataTable GetDataTable3()
  214. {
  215. SqlParameter[] parms = new SqlParameter[]
  216. {
  217. new SqlParameter("@SqlWhere", SqlDbType.VarChar,8000),
  218. new SqlParameter("@PageSize", SqlDbType.Int),
  219. new SqlParameter("@PageIndex", SqlDbType.Int),
  220. new SqlParameter("@SqlTable", SqlDbType.VarChar,8000),
  221. new SqlParameter("@SqlField", SqlDbType.VarChar,8000),
  222. new SqlParameter("@SqlPK", SqlDbType.VarChar,50),
  223. new SqlParameter("@SqlOrder", SqlDbType.VarChar,200),
  224. new SqlParameter("@Count", SqlDbType.Int),
  225. };
  226. parms[0].Value = searchSentence;
  227. parms[1].Value = pageSize;
  228. parms[2].Value = sequence;
  229. parms[3].Value = tableName;
  230. parms[4].Value = searchField;
  231. parms[5].Value = primarykey;
  232. parms[6].Value = sortSentence;
  233. parms[7].Direction = ParameterDirection.Output;
  234. DataTable dt = new DataTable(); ;
  235. using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
  236. {
  237. dt = DbHelperSQL.ExecuteDataTable(conn, CommandType.StoredProcedure, "PaginationData", parms);
  238. RecordCount = int.Parse((parms[7].Value.ToString()));
  239. conn.Close();
  240. conn.Dispose();
  241. }
  242. return dt;
  243. }
  244. /// <summary>
  245. /// 获取分页功能条 模式: 首页 | 上一页 | 下一页 | 尾页 第 Sequence 页 | 共 RecordCount / PageSize 页 | 每页 PageSize
  246. /// </summary>
  247. public void PageBarByStyle1()
  248. {
  249. string htmlText = "<table class=\"pageBar\" cellspacing=\"0\" cellpadding=\"5\">";
  250. htmlText += "<tr><td style=\"width:18%\" bgcolor=\"#ffffff\" align=\"center\">";
  251. htmlText += "<font color=\"#00000\"><span class=\"fonten_amount\">{0} {1}</span></font></td>";
  252. htmlText += "<td bgcolor=\"#ffffff\" style=\"width:32%\">第<b>{2}</b>页 | 共<b>{3}</b>页 | 每页<b>{4}</b>{1}</td>";
  253. htmlText += "<td bgcolor=\"#ffffff\" style=\"width:32%\" align=\"center\">{5}</td>";
  254. htmlText += "</td></tr></table>";
  255. int PageCount = 0;
  256. if ((RecordCount % PageSize) == 0)
  257. PageCount = RecordCount / PageSize;
  258. else
  259. PageCount = RecordCount / PageSize + 1;
  260. if (PageCount < Sequence)
  261. Sequence = PageCount;
  262. if (PageCount <= 0)
  263. Sequence = 1;
  264. string str = "";
  265. if (Sequence < 2)
  266. str += "首页 | 上一页 | ";
  267. else
  268. {
  269. str += "<a href=\"" + UrlStr + "page=1\" class=\"link_page\">首页</a> | ";
  270. str += "<a href=\"" + UrlStr + "page=" + (Sequence - 1) + "\" class=\"link_page\">上一页</a> | ";
  271. }
  272. if ((PageCount - Sequence) < 1)
  273. str += "下一页 | 尾页 ";
  274. else
  275. {
  276. str += "<a href=\"" + UrlStr + "page=" + (Sequence + 1) + "\" class=\"link_page\">下一页</a> | ";
  277. str += "<a href=\"" + UrlStr + "page=" + PageCount + "\" class=\"link_page\">尾页</a>";
  278. }
  279. PageBar = string.Format(htmlText, RecordCount.ToString(), ItemUnit, Sequence.ToString(), PageCount.ToString(), PageSize.ToString(), str);
  280. }
  281. /// <summary>
  282. /// 获取分页功能条 模式: 首页 | 上一页 | 下一页 | 尾页 第 Sequence 页 | 共 RecordCount / PageSize 页 | 每页 PageSize
  283. /// </summary>
  284. public void PageBarByStyles1()
  285. {
  286. string htmlText = "<table class=\"pageBar\" cellspacing=\"0\" cellpadding=\"5\">";
  287. htmlText += "<tr><td bgcolor=\"#ffffff\" style=\"width:32%\">第<b>{2}</b>页 | 共<b>{3}</b>页 | 每页<b>{4}</b>{1}</td>";
  288. htmlText += "<td bgcolor=\"#ffffff\" style=\"width:32%\" align=\"center\">{5}</td>";
  289. htmlText += "</td></tr></table>";
  290. int PageCount = 0;
  291. if ((RecordCount % PageSize) == 0)
  292. PageCount = RecordCount / PageSize;
  293. else
  294. PageCount = RecordCount / PageSize + 1;
  295. if (PageCount < Sequence)
  296. Sequence = PageCount;
  297. if (PageCount <= 0)
  298. Sequence = 1;
  299. string str = "";
  300. if (Sequence < 2)
  301. str += "首页 | 上一页 | ";
  302. else
  303. {
  304. str += "<a href=\"#\" onclick=\"return pagination(1);\" class=\"link_page\">首页</a> | ";
  305. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence - 1) + ");\" class=\"link_page\">上一页</a> | ";
  306. }
  307. if ((PageCount - Sequence) < 1)
  308. str += "下一页 | 尾页 ";
  309. else
  310. {
  311. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence + 1) + ");\" class=\"link_page\">下一页</a> | ";
  312. str += "<a href=\"#\" onclick=\"return pagination(" + PageCount + ");\" class=\"link_page\">尾页</a>";
  313. }
  314. PageBar = string.Format(htmlText, RecordCount.ToString(), ItemUnit, Sequence.ToString(), PageCount.ToString(), PageSize.ToString(), str);
  315. }
  316. /// <summary>
  317. /// 数字模式分页功能条,如 << 1 2 3 4 5 6 7 8 9 >>
  318. /// </summary>
  319. public void NumeberPageBar()
  320. {
  321. int PageCount = 0;
  322. if ((RecordCount % PageSize) == 0)
  323. PageCount = RecordCount / PageSize;
  324. else
  325. PageCount = RecordCount / PageSize + 1;
  326. if (PageCount < Sequence)
  327. Sequence = PageCount;
  328. if (PageCount <= 0)
  329. Sequence = 1;
  330. string str = "Page {0} of {1} &nbsp;&nbsp;&nbsp; {2} &nbsp;{3}&nbsp; {4}", temp = "", previous = "", next = "";
  331. int areaS = 1, areaE = PageCount;
  332. if (PageCount > 10 && Sequence > 4)
  333. {
  334. areaS = Sequence - 4;
  335. areaE = Sequence - 4 + 9;
  336. }
  337. if (Sequence > 1)
  338. {
  339. previous = "<a href=\"" + UrlStr + "page=" + (Sequence + 1) + "\">Previous</a>";
  340. next = "<a href=\"" + UrlStr + "page=" + (Sequence - 1) + "\">Next</a>";
  341. }
  342. else
  343. {
  344. previous = "Previous";
  345. next = "Next";
  346. }
  347. for (int i = areaS; i <= areaE; i++)
  348. {
  349. if (i == Sequence)
  350. temp += "<a href=\"" + UrlStr + "page=" + i.ToString() + "\"><font color=\"#FF6600\">" + i.ToString() + "</a></font> ";
  351. else
  352. temp += "<a href=\"" + UrlStr + "page=" + i.ToString() + "\">" + i.ToString() + "</a> ";
  353. }
  354. str = string.Format(str, Sequence.ToString(), PageCount.ToString(), previous, temp, next);
  355. PageBar = str;
  356. }
  357. /// <summary>
  358. /// 类似百度 google的分页,如 <<{0} 上一页{1} 1 2 3 4 5 6 7 8 9{2} 下一页{3} >>{4} 跳转[8]{5}
  359. /// </summary>
  360. public void GoNumeberPageBar1()
  361. {
  362. string pageHtml = "{0}&nbsp;&nbsp;&nbsp;&nbsp;{1}&nbsp;&nbsp;{2}&nbsp;&nbsp;{3}&nbsp;&nbsp;&nbsp;&nbsp;{4}&nbsp;&nbsp;&nbsp;&nbsp;{5}";
  363. string page0 = "", page1 = "", page2 = "", page3 = "", page4 = "", page5 = "";
  364. int tempallpage = 1;
  365. if ((RecordCount % PageSize) == 0)
  366. tempallpage = RecordCount / PageSize;
  367. else
  368. tempallpage = RecordCount / PageSize + 1;
  369. page5 = "&nbsp;&nbsp;<input id='goPageNumTemp' value='" + Sequence + "' style='width:40px;height:16px;BORDER-RIGHT: #7b9ebd 1px solid; BORDER-TOP: #7b9ebd 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #7b9ebd 1px solid; BORDER-BOTTOM: #7b9ebd 1px solid;' onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" />&nbsp;&nbsp;<button onclick=\"var strgonum=document.getElementById('goPageNumTemp').value;if(strgonum!=''){if(strgonum>" + tempallpage + "){pagination(" + tempallpage + ");}else{pagination(strgonum);}}else{pagination(" + Sequence + ");}\" class='btn' style='width:30px;'>Go</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共&nbsp;" + tempallpage + "&nbsp;页";
  370. if (Sequence <= PageBarSize)
  371. {
  372. page0 = "&lt;&lt;";
  373. page1 = "上一页";
  374. }
  375. else
  376. {
  377. if ((Sequence - PageBarSize) > 0)
  378. {
  379. page0 = "<a href=\"#\" onclick=\"pagination(" + (Sequence - PageBarSize) + ");\">&lt;&lt;</a>";
  380. }
  381. else
  382. {
  383. page0 = "<a href=\"#\" onclick=\"pagination(1);\">&lt;&lt;</a>";
  384. }
  385. page1 = "<a href=\"#\" onclick=\"pagination(" + (Sequence - 1) + ");\">上一页</a>";
  386. }
  387. if ((tempallpage - Sequence + 1) < PageBarSize)
  388. {
  389. page3 = "下一页";
  390. page4 = "&gt;&gt;";
  391. }
  392. else
  393. {
  394. page3 = "<a href=\"#\" onclick=\"pagination(" + (Sequence + 1) + ");\">下一页</a>";
  395. if ((Sequence + PageBarSize) > tempallpage)
  396. {
  397. page4 = "<a href=\"#\" onclick=\"pagination(" + tempallpage + ");\">&gt;&gt;</a>";
  398. }
  399. else
  400. {
  401. page4 = "<a href=\"#\" onclick=\"pagination(" + (Sequence + PageBarSize) + ");\">&gt;&gt;</a>";
  402. }
  403. }
  404. if (tempallpage < PageSize)
  405. {
  406. for (int i = 1; i <= tempallpage; i++)
  407. {
  408. if (i == Sequence)
  409. {
  410. page2 += "&nbsp;<font color=Red>" + i + "</font>&nbsp;";
  411. }
  412. else
  413. {
  414. page2 += "&nbsp;<a href=\"#\" onclick=\"pagination(" + i + ");\">" + i + "</a>&nbsp;";
  415. }
  416. }
  417. }
  418. else
  419. {
  420. int tempcount = 1;
  421. if (Sequence % PageBarSize == 0)
  422. {
  423. tempcount = Sequence / PageBarSize - 1;
  424. }
  425. else
  426. {
  427. tempcount = Sequence / PageBarSize;
  428. }
  429. tempcount = tempcount * PageBarSize;
  430. for (int i = 1; i <= PageBarSize; i++)
  431. {
  432. tempcount++;
  433. if (tempcount <= tempallpage)
  434. {
  435. if (tempcount == Sequence)
  436. {
  437. page2 += "&nbsp;<font color=Red>" + tempcount + "</font>&nbsp;";
  438. }
  439. else
  440. {
  441. page2 += "&nbsp;<a href=\"#\" onclick=\"pagination(" + tempcount + ");\">" + tempcount + "</a>&nbsp;";
  442. }
  443. }
  444. }
  445. }
  446. PageBar = string.Format(pageHtml, page0, page1, page2, page3, page4, page5);
  447. }
  448. /// <summary>
  449. /// 类似百度 google的分页,如 <<{0} 上一页{1} 1 2 3 4 5 6 7 8 9{2} 下一页{3} >>{4} 跳转[8]{5}
  450. /// </summary>
  451. public void GoNumeberPageBar()
  452. {
  453. string pageHtml = "{0}&nbsp;&nbsp;&nbsp;&nbsp;{1}&nbsp;&nbsp;&nbsp;&nbsp;{2}";
  454. string page0 = "", page2 = "", page4 = "";
  455. int tempallpage = 1;
  456. if ((RecordCount % PageSize) == 0)
  457. tempallpage = RecordCount / PageSize;
  458. else
  459. tempallpage = RecordCount / PageSize + 1;
  460. if (Sequence <= PageBarSize)
  461. {
  462. page0 = "";
  463. }
  464. else
  465. {
  466. if ((Sequence - PageBarSize) > 0)
  467. {
  468. page0 = "<span><a href=\"#\" title='Previous Group' onclick=\"pagination(" + (Sequence - PageBarSize) + ");\">&lt;&lt;</a></span>";
  469. }
  470. else
  471. {
  472. page0 = "<span><a href=\"#\" title='Previous Group' onclick=\"pagination(1);\">&lt;&lt;</a></span>";
  473. }
  474. }
  475. if ((tempallpage - Sequence + 1) < PageBarSize)
  476. {
  477. page4 = "";
  478. if (tempallpage != Sequence)
  479. {
  480. page4 = "<span><a href=\"#\" title='Next Group' onclick=\"pagination(" + tempallpage + ");\">&gt;&gt;</a></span>";
  481. }
  482. }
  483. else
  484. {
  485. if ((Sequence + PageBarSize) > tempallpage)
  486. {
  487. page4 = "<span><a href=\"#\" title='Next Group' onclick=\"pagination(" + tempallpage + ");\">&gt;&gt;</a></span>";
  488. }
  489. else
  490. {
  491. page4 = "<span><a href=\"#\" title='Next Group' onclick=\"pagination(" + (Sequence + PageBarSize) + ");\">&gt;&gt;</a></span>";
  492. }
  493. }
  494. if (tempallpage < PageSize)
  495. {
  496. for (int i = 1; i <= tempallpage; i++)
  497. {
  498. if (i == Sequence)
  499. {
  500. page2 += "&nbsp;<span class=\"cp\"><strong>" + i + "</strong></span>&nbsp;";
  501. }
  502. else
  503. {
  504. page2 += "&nbsp;<span><a href=\"#\" onclick=\"pagination(" + i + ");\">" + i + "</a></span>&nbsp;";
  505. }
  506. }
  507. }
  508. else
  509. {
  510. int tempcount = 1;
  511. if (Sequence % PageBarSize == 0)
  512. {
  513. tempcount = Sequence / PageBarSize - 1;
  514. }
  515. else
  516. {
  517. tempcount = Sequence / PageBarSize;
  518. }
  519. tempcount = tempcount * PageBarSize;
  520. for (int i = 1; i <= PageBarSize; i++)
  521. {
  522. tempcount++;
  523. if (tempcount <= tempallpage)
  524. {
  525. if (tempcount == Sequence)
  526. {
  527. page2 += "&nbsp;<span class=\"cp\"><strong>" + tempcount + "</strong></span>&nbsp;";
  528. }
  529. else
  530. {
  531. page2 += "&nbsp;<span><a href=\"#\" onclick=\"pagination(" + tempcount + ");\">" + tempcount + "</a></span>&nbsp;";
  532. }
  533. }
  534. }
  535. }
  536. if (PageBarSize >= tempallpage)
  537. {
  538. page0 = "";
  539. page4 = "";
  540. }
  541. PageBar = string.Format(pageHtml, page0, page2, page4);
  542. }
  543. /// <summary>
  544. /// 类似百度 google的分页,如 <<{0} 上一页{1} 1 2 3 4 5 6 7 8 9{2} 下一页{3} >>{4} 跳转[8]{5}
  545. /// </summary>
  546. public void GoNumeberPageBar2()
  547. {
  548. string pageHtml = "{6}&nbsp;&nbsp;{0}&nbsp;&nbsp;&nbsp;&nbsp;{1}&nbsp;&nbsp;{2}&nbsp;&nbsp;{3}&nbsp;&nbsp;&nbsp;&nbsp;{4}&nbsp;&nbsp;&nbsp;&nbsp;{5}";
  549. string page0 = "", page1 = "", page2 = "", page3 = "", page4 = "", page5 = "", page6 = "";
  550. int tempallpage = 1;
  551. if ((RecordCount % PageSize) == 0)
  552. tempallpage = RecordCount / PageSize;
  553. else
  554. tempallpage = RecordCount / PageSize + 1;
  555. page5 = "&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;<strong>" + tempallpage + "</strong>&nbsp;Pages";// "&nbsp;&nbsp;<input id='goPageNumTemp' value='" + Sequence + "' style='width:40px;height:16px;BORDER-RIGHT: #7b9ebd 1px solid; BORDER-TOP: #7b9ebd 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #7b9ebd 1px solid; BORDER-BOTTOM: #7b9ebd 1px solid;' onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" />&nbsp;&nbsp;<button onclick=\"var strgonum=document.getElementById('goPageNumTemp').value;if(strgonum!=''){if(strgonum>" + tempallpage + "){pagination(" + tempallpage + ");}else{pagination(strgonum);}}else{pagination(" + Sequence + ");}\" class='btn' style='width:30px;'>Go</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共&nbsp;" + tempallpage + "&nbsp;页";
  556. if (tempallpage != 1)
  557. {
  558. int start = 1;
  559. int end = tempallpage;
  560. //tempallpage % PageBarSize
  561. if (PageBarSize < tempallpage)
  562. {
  563. if (Sequence <= PageBarSize)
  564. {
  565. end = PageBarSize;
  566. }
  567. else
  568. {
  569. if ((Sequence % PageBarSize) == 0)
  570. {
  571. start = ((Sequence / PageBarSize) - 1) * PageBarSize + 1;
  572. end = Sequence;
  573. }
  574. else
  575. {
  576. start = ((Sequence / PageBarSize)) * PageBarSize + 1;
  577. end = (Sequence / PageBarSize + 1) * PageBarSize;
  578. if (end > tempallpage)
  579. {
  580. end = tempallpage;
  581. }
  582. }
  583. }
  584. }
  585. page6 = "<strong>" + start.ToString() + "&nbsp;-&nbsp;" + end.ToString() + "</strong>&nbsp;&nbsp;Pages";
  586. }
  587. if (Sequence <= PageBarSize)
  588. {
  589. page0 = "";
  590. page1 = "";
  591. }
  592. else
  593. {
  594. if ((Sequence - PageBarSize) > 0)
  595. {
  596. page0 = "<span><a href=\"#\" onclick=\"pagination(" + (Sequence - PageBarSize) + ");\">&lt;&lt;</a></span>";
  597. }
  598. else
  599. {
  600. page0 = "<span><a href=\"#\" onclick=\"pagination(1);\">&lt;&lt;</a></span>";
  601. }
  602. page1 = "<span><a href=\"#\" onclick=\"pagination(" + (Sequence - 1) + ");\">Previous</a></span>";
  603. }
  604. if ((tempallpage - Sequence + 1) < PageBarSize)
  605. {
  606. page3 = "";
  607. page4 = "";
  608. if (tempallpage != Sequence)
  609. {
  610. page3 = "<span><a href=\"#\" onclick=\"pagination(" + (Sequence + 1) + ");\">Next</a></span>";
  611. page4 = "<span><a href=\"#\" onclick=\"pagination(" + tempallpage + ");\">&gt;&gt;</a></span>";
  612. }
  613. }
  614. else
  615. {
  616. page3 = "<span><a href=\"#\" onclick=\"pagination(" + (Sequence + 1) + ");\">Next</a></span>";
  617. if ((Sequence + PageBarSize) > tempallpage)
  618. {
  619. page4 = "<span><a href=\"#\" onclick=\"pagination(" + tempallpage + ");\">&gt;&gt;</a></span>";
  620. }
  621. else
  622. {
  623. page4 = "<span><a href=\"#\" onclick=\"pagination(" + (Sequence + PageBarSize) + ");\">&gt;&gt;</a></span>";
  624. }
  625. }
  626. if (tempallpage < PageSize)
  627. {
  628. for (int i = 1; i <= tempallpage; i++)
  629. {
  630. if (i == Sequence)
  631. {
  632. page2 += "&nbsp;<span class=\"cp\"><strong>" + i + "</strong></span>&nbsp;";
  633. }
  634. else
  635. {
  636. page2 += "&nbsp;<span><a href=\"#\" onclick=\"pagination(" + i + ");\">" + i + "</a></span>&nbsp;";
  637. }
  638. }
  639. }
  640. else
  641. {
  642. int tempcount = 1;
  643. if (Sequence % PageBarSize == 0)
  644. {
  645. tempcount = Sequence / PageBarSize - 1;
  646. }
  647. else
  648. {
  649. tempcount = Sequence / PageBarSize;
  650. }
  651. tempcount = tempcount * PageBarSize;
  652. for (int i = 1; i <= PageBarSize; i++)
  653. {
  654. tempcount++;
  655. if (tempcount <= tempallpage)
  656. {
  657. if (tempcount == Sequence)
  658. {
  659. page2 += "&nbsp;<span class=\"cp\"><strong>" + tempcount + "</strong></span>&nbsp;";
  660. }
  661. else
  662. {
  663. page2 += "&nbsp;<span><a href=\"#\" onclick=\"pagination(" + tempcount + ");\">" + tempcount + "</a></span>&nbsp;";
  664. }
  665. }
  666. }
  667. }
  668. if (PageBarSize >= tempallpage)
  669. {
  670. page0 = "";
  671. page1 = "";
  672. page3 = "";
  673. page4 = "";
  674. }
  675. PageBar = string.Format(pageHtml, page0, page1, page2, page3, page4, page5, page6);
  676. }
  677. /// <summary>
  678. /// 无刷新分页模式 当前第 {0} 页. 共 {1} 页. 每页 {2} 条. 共 {3} 条. 首页 上一页 下一页 末页 转到 页
  679. /// </summary>
  680. public void GoPageBarStyle1()
  681. {
  682. string pageHtml = "<div style=\"float:left; width:48%;\">当前第 {0}/{1} 页. 每页 {2} 条. 共 {3} 条</div><div style=\"float:right; width:48%; text-align:right;\">{4} {5}</div>";
  683. string page0 = "", page1 = "", page2 = "", page3 = "", page4 = "", page5 = "";
  684. page0 = Sequence.ToString();
  685. int tempallpage = 1;
  686. if ((RecordCount % PageSize) == 0)
  687. tempallpage = RecordCount / PageSize;
  688. else
  689. tempallpage = RecordCount / PageSize + 1;
  690. page1 = tempallpage.ToString();
  691. page2 = PageSize.ToString();
  692. page3 = RecordCount.ToString();
  693. page5 = "<span onclick=\"var strgonum=document.getElementById('goPageNumTemp').value;if(strgonum!=''){if(strgonum>" + tempallpage + "){pagination(" + tempallpage + ");}else{pagination(strgonum);}}else{pagination(" + Sequence + ");}\" style='width:30px;cursor:hand;'>转到</span>&nbsp;&nbsp;<input id='goPageNumTemp' value='" + Sequence + "' style='width:40px;height:16px;BORDER-RIGHT: #7b9ebd 1px solid; BORDER-TOP: #7b9ebd 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #7b9ebd 1px solid; BORDER-BOTTOM: #7b9ebd 1px solid;' onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" />&nbsp;页";
  694. if (Sequence < 2)
  695. page4 += "<a href=\"javascript:void(null)\">首页</a> <a href=\"javascript:void(null)\">上一页</a>";
  696. else
  697. {
  698. page4 += "<a href=\"javascript:void(null)\" onclick=\"pagination(1);\">首页</a>&nbsp;";
  699. page4 += "<a href=\"javascript:void(null)\" onclick=\"pagination(" + (Sequence - 1) + ");\">上一页</a>&nbsp;";
  700. }
  701. if ((tempallpage - Sequence) < 1)
  702. page4 += "&nbsp;<a href=\"javascript:void(null)\">下一页</a> <a href=\"javascript:void(null)\">末页</a>";
  703. else
  704. {
  705. page4 += "&nbsp;<a href=\"javascript:void(null)\" onclick=\"pagination(" + (Sequence + 1) + ");\">下一页</a>&nbsp;";
  706. page4 += "<a href=\"javascript:void(null)\" onclick=\"pagination(" + tempallpage + ");\">末页</a>";
  707. }
  708. PageBar = string.Format(pageHtml, page0, page1, page2, page3, page4, page5);
  709. }
  710. /// <summary>
  711. /// 无刷新分页模式 当前第 {0} 页. 共 {1} 页. 每页 {2} 条. 共 {3} 条. 首页 上一页 下一页 末页 转到 页
  712. /// </summary>
  713. public void GoPageBarStyle1(string funname)
  714. {
  715. string pageHtml = "<div style=\"float:left; width:48%;\">当前第 {0}/{1} 页. 每页 {2} 条. 共 {3} 条</div><div style=\"float:right; width:48%; text-align:right;\">{4} {5}</div>";
  716. string page0 = "", page1 = "", page2 = "", page3 = "", page4 = "", page5 = "";
  717. page0 = Sequence.ToString();
  718. int tempallpage = 1;
  719. if ((RecordCount % PageSize) == 0)
  720. tempallpage = RecordCount / PageSize;
  721. else
  722. tempallpage = RecordCount / PageSize + 1;
  723. page1 = tempallpage.ToString();
  724. page2 = PageSize.ToString();
  725. page3 = RecordCount.ToString();
  726. page5 = "<span onclick=\"var strgonum=document.getElementById('goPageNumTemp').value;if(strgonum!=''){if(strgonum>" + tempallpage + "){" + funname + "(" + tempallpage + ");}else{" + funname + "(strgonum);}}else{" + funname + "(" + Sequence + ");}\" style='width:30px;cursor:hand;'>转到</span>&nbsp;&nbsp;<input id='goPageNumTemp' value='" + Sequence + "' style='width:40px;height:16px;BORDER-RIGHT: #7b9ebd 1px solid; BORDER-TOP: #7b9ebd 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #7b9ebd 1px solid; BORDER-BOTTOM: #7b9ebd 1px solid;' onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" />&nbsp;页";
  727. if (Sequence < 2)
  728. page4 += "<a href=\"javascript:void(null)\">首页</a> <a href=\"javascript:void(null)\">上一页</a>";
  729. else
  730. {
  731. page4 += "<a href=\"javascript:void(null)\" onclick=\"" + funname + "(1);\">首页</a>&nbsp;";
  732. page4 += "<a href=\"javascript:void(null)\" onclick=\"" + funname + "(" + (Sequence - 1) + ");\">上一页</a>&nbsp;";
  733. }
  734. if ((tempallpage - Sequence) < 1)
  735. page4 += "&nbsp;<a href=\"javascript:void(null)\">下一页</a> <a href=\"javascript:void(null)\">末页</a>";
  736. else
  737. {
  738. page4 += "&nbsp;<a href=\"javascript:void(null)\" onclick=\"" + funname + "(" + (Sequence + 1) + ");\">下一页</a>&nbsp;";
  739. page4 += "<a href=\"javascript:void(null)\" onclick=\"" + funname + "(" + tempallpage + ");\">末页</a>";
  740. }
  741. PageBar = string.Format(pageHtml, page0, page1, page2, page3, page4, page5);
  742. }
  743. /// <summary>
  744. /// 分页功能条(无刷新模式)
  745. /// </summary>
  746. public void PageBarUnRefresh()
  747. {
  748. string htmlText = "<div>";
  749. htmlText += "<h1 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">{0}</h1>";
  750. htmlText += "<h2 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">共计: {1} {2} {3}</h2>";
  751. htmlText += "</div>";
  752. int intPageCount = 0;
  753. if ((RecordCount % PageSize) == 0)
  754. intPageCount = RecordCount / PageSize;
  755. else
  756. intPageCount = RecordCount / PageSize + 1;
  757. string str = "";
  758. if (Sequence < 2)
  759. str += "<img src=\"" + ImagesPath + "page_FL0.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" />&nbsp;<img src=\"" + ImagesPath + "page_L0.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" />&nbsp;";
  760. else
  761. {
  762. str += "<a href=\"#\" onclick=\"return pagination(1);\"><img src=\"" + ImagesPath + "page_FL1.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" /></a>&nbsp;";
  763. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence - 1) + ");\"><img src=\"" + ImagesPath + "page_L1.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" /></a>&nbsp;";
  764. }
  765. if ((intPageCount - Sequence) < 1)
  766. str += "<img src=\"" + ImagesPath + "page_R0.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" />&nbsp;<img src=\"" + ImagesPath + "page_LL0.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" />&nbsp;";
  767. else
  768. {
  769. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence + 1) + ");\"><img src=\"" + ImagesPath + "page_R1.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" /></a>&nbsp;";
  770. str += "<a href=\"#\" onclick=\"return pagination(" + intPageCount + ");\"><img src=\"" + ImagesPath + "page_LL1.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" /></a>&nbsp;";
  771. }
  772. string strPage = Sequence.ToString() + "/" + intPageCount.ToString();
  773. PageBar = string.Format(htmlText, str, RecordCount, ItemUnit, strPage);
  774. }
  775. /// <summary>
  776. /// 分页功能条(无刷新模式)
  777. /// </summary>
  778. public void PageBarUnRefreshbak()
  779. {
  780. string htmlText = "<div>";
  781. htmlText += "<h1 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">{0}</h1>";
  782. htmlText += "<h2 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">共计: {1} {2} {3}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{4}</h2>";
  783. htmlText += "</div>";
  784. int intPageCount = 0;
  785. if ((RecordCount % PageSize) == 0)
  786. intPageCount = RecordCount / PageSize;
  787. else
  788. intPageCount = RecordCount / PageSize + 1;
  789. string str = "";
  790. if (Sequence < 2)
  791. str += "<img src=\"" + ImagesPath + "page_FL0.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" />&nbsp;<img src=\"" + ImagesPath + "page_L0.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" />&nbsp;";
  792. else
  793. {
  794. str += "<a href=\"#\" onclick=\"return pagination(1);\"><img src=\"" + ImagesPath + "page_FL1.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" /></a>&nbsp;";
  795. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence - 1) + ");\"><img src=\"" + ImagesPath + "page_L1.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" /></a>&nbsp;";
  796. }
  797. if ((intPageCount - Sequence) < 1)
  798. str += "<img src=\"" + ImagesPath + "page_R0.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" />&nbsp;<img src=\"" + ImagesPath + "page_LL0.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" />&nbsp;";
  799. else
  800. {
  801. str += "<a href=\"#\" onclick=\"return pagination(" + (Sequence + 1) + ");\"><img src=\"" + ImagesPath + "page_R1.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" /></a>&nbsp;";
  802. str += "<a href=\"#\" onclick=\"return pagination(" + intPageCount + ");\"><img src=\"" + ImagesPath + "page_LL1.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" /></a>&nbsp;";
  803. }
  804. string page5 = "";
  805. string strPage = Sequence.ToString() + "/" + intPageCount.ToString();
  806. page5 = "<input id='goPageNumTemp' value='" + Sequence + "' style='width:40px;height:16px;BORDER-RIGHT: #7b9ebd 1px solid; BORDER-TOP: #7b9ebd 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #7b9ebd 1px solid; BORDER-BOTTOM: #7b9ebd 1px solid;' onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" />&nbsp;页&nbsp;&nbsp;<button style='width:50px;height:18px;' onclick=\"var strgonum=document.getElementById('goPageNumTemp').value;if(strgonum!=''){if(strgonum>" + intPageCount + "){pagination(" + intPageCount + ");}else{pagination(strgonum);}}else{pagination(" + Sequence + ");}\">转到</button>";
  807. PageBar = string.Format(htmlText, str, RecordCount, ItemUnit, strPage, page5);
  808. }
  809. /// <summary>
  810. /// 分页功能条(无刷新模式)
  811. /// </summary>
  812. /// <param name="i">子列表分页编序paginationNum,子列表上级ID</param>
  813. public void ChildPageBarUnRefresh(int i)
  814. {
  815. string htmlText = "<div>";
  816. htmlText += "<h1 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">{0}</h1>";
  817. htmlText += "<h2 style=\"float: left; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; font-size: 12px;font-weight: normal;\">共计: {1} {2} {3}</h2>";
  818. htmlText += "</div>";
  819. int intPageCount = 0;
  820. if ((RecordCount % PageSize) == 0)
  821. intPageCount = RecordCount / PageSize;
  822. else
  823. intPageCount = RecordCount / PageSize + 1;
  824. string str = "";
  825. if (Sequence < 2)
  826. str += "<img name=\"none\" src=\"" + ImagesPath + "page_FL0.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" />&nbsp;<img name=\"none\" src=\"" + ImagesPath + "page_L0.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" />&nbsp;";
  827. else
  828. {
  829. str += "<a href=\"#\" onclick=\"return paginationNum(" + i + ",1);\"><img src=\"" + ImagesPath + "page_FL1.gif\" style=\"border:0px; margin: 0 5px 0 25px;\" /></a>&nbsp;";
  830. str += "<a href=\"#\" onclick=\"return paginationNum(" + i + "," + (Sequence - 1) + ");\"><img src=\"" + ImagesPath + "page_L1.gif\" style=\"border:0px; margin: 0 10px 0 5px;\" /></a>&nbsp;";
  831. }
  832. if ((intPageCount - Sequence) < 1)
  833. str += "<img name=\"none\" src=\"" + ImagesPath + "page_R0.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" />&nbsp;<img name=\"none\" src=\"" + ImagesPath + "page_LL0.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" />&nbsp;";
  834. else
  835. {
  836. str += "<a href=\"#\" onclick=\"return paginationNum(" + i + "," + (Sequence + 1) + ");\"><img name=\"none\" src=\"" + ImagesPath + "page_R1.gif\" style=\"border:0px; margin: 0 5px 0 10px;\" /></a>&nbsp;";
  837. str += "<a href=\"#\" onclick=\"return paginationNum(" + i + "," + intPageCount + ");\"><img name=\"none\" src=\"" + ImagesPath + "page_LL1.gif\" style=\"border:0px; margin: 0 25px 0 5px;\" /></a>&nbsp;";
  838. }
  839. string strPage = Sequence.ToString() + "/" + intPageCount.ToString();
  840. PageBar = string.Format(htmlText, str, RecordCount, ItemUnit, strPage);
  841. }
  842. #region 分页 法拉利模式分页
  843. public void PageBarFerrari()
  844. {
  845. int intPageCount = 0;
  846. if ((RecordCount % PageSize) == 0)
  847. intPageCount = RecordCount / PageSize;
  848. else
  849. intPageCount = RecordCount / PageSize + 1;
  850. string str = "";
  851. if (Sequence < 2)
  852. {
  853. str += "<a class=\"toolbarbutton\" id=\"f_fastRewind\" disabled onclick=\"return false;\" href=\"javascript:onclick();\" target=\"_self\"><img id=\"f_page_FL0\" disabled alt=\"加载首页\" src=\"" + ImagesPath + "page_FL0.gif\" align=\"absMiddle\"></a>";
  854. str += "<a class=\"toolbarbutton\" id=\"f__prevPageImg\" disabled onclick=\"return false;\" href=\"javascript:onclick();\" target=\"_self\"><img id=\"f_page_L0\" disabled alt=\"加载上一页\" hspace=\"6\" src=\"" + ImagesPath + "page_L0.gif\" align=\"absMiddle\"></a>";
  855. }
  856. else
  857. {
  858. str += "<a class=\"toolbarbutton\" id=\"f_fastRewind\" onclick=\"return pagination(1);\" href=\"javascript:onclick();\" target=\"_self\" ><img id=\"f_page_FL1\" alt=\"加载首页\" src=\"" + ImagesPath + "page_FL1.gif\" align=\"absMiddle\"></a>";
  859. str += "<a class=\"toolbarbutton\" id=\"f__prevPageImg\" onclick=\"return pagination(" + (Sequence - 1) + ");\" href=\"javascript:onclick();\" target=\"_self\" ><img id=\"f_page_L1\" alt=\"加载上一页\" hspace=\"6\" src=\"" + ImagesPath + "page_L1.gif\" align=\"absMiddle\"></a>";
  860. }
  861. str += "第 <span id=\"f__PageNum\">" + Sequence + "</span> 页";
  862. if ((intPageCount - Sequence) < 1)
  863. {
  864. str += "<a class=\"toolbarbutton\" id=\"f__nextPageImg\" disabled onclick=\"return false;\" href=\"javascript:onclick();\" target=\"_self\"><img id=\"f_page_R0\" disabled alt=\"加载下一页\" hspace=\"6\" src=\"" + ImagesPath + "page_R0.gif\" align=\"absMiddle\"></a>";
  865. str += "<a class=\"toolbarbutton\" id=\"f_lastPageImg\" disabled onclick=\"return false;\" href=\"javascript:onclick();\" target=\"_self\"><img id=\"f_page_LR0\" disabled alt=\"加载尾页\" hspace=\"6\" src=\"" + ImagesPath + "page_LR0.gif\" align=\"absMiddle\"></a>";
  866. }
  867. else
  868. {
  869. str += "<a class=\"toolbarbutton\" id=\"f__nextPageImg\" onclick=\"return pagination(" + (Sequence + 1) + ");\" href=\"javascript:onclick();\" target=\"_self\" ><img id=\"f_page_R1\" alt=\"加载下一页\" hspace=\"6\" src=\"" + ImagesPath + "page_R1.gif\" align=\"absMiddle\" /></a>";
  870. str += "<a class=\"toolbarbutton\" id=\"f_lastPageImg\" onclick=\"return pagination(" + intPageCount + ");\" href=\"javascript:onclick();\" target=\"_self\" ><img id=\"f_page_LR1\" alt=\"加载尾页\" hspace=\"6\" src=\"" + ImagesPath + "page_LR1.gif\" align=\"absMiddle\" /></a>";
  871. }
  872. //string strPage = Sequence.ToString() + "/" + intPageCount.ToString();
  873. PageBar = str + "&nbsp;";//string.Format(htmlText, str, RecordCount, ItemUnit, strPage);
  874. }
  875. #endregion
  876. #endregion
  877. #region 构造
  878. public Pagination()
  879. {
  880. }
  881. #endregion
  882. }
  883. }