runxinzhi.com
首页
百度搜索
多列分页算法
private
void
ShowRecord(
int
RecordCount,
int
CellCount,
int
CurrentPage)
{
int
CurrentRC,TotalCount,FinalCount,CurrentLocation;
string
ImageName,ImageUrl;
TableRow Tr
=
new
TableRow();
TableCell Tc
=
new
TableCell();
TotalCount
=
RecordInfo.GetRecordCount();
FinalCount
=
TotalCount
/
CellCount
+
1
;
TotalPage
=
(FinalCount
-
1
)
/
RecordCount
+
1
;
CurrentRC
=
FinalCount
-
(CurrentPage
-
1
)
*
RecordCount;
if
(CurrentRC
>
RecordCount) CurrentRC
=
RecordCount;
if
(CurrentPage
>
TotalPage) CurrentPage
=
1
;
for
(
int
i
=
(CurrentPage
-
1
)
*
RecordCount;i
<
CurrentRC
+
(CurrentPage
-
1
)
*
RecordCount;i
++
)
{
Tc.Controls.Add(
new
LiteralControl(
"
<table><tr>
"
));
for
(
int
j
=
1
;j
<=
CellCount;j
++
)
{
CurrentLocation
=
(CurrentPage
-
1
)
*
RecordCount
*
CellCount
+
(i
%
RecordCount)
*
CellCount
+
j;
if
(TotalCount
>=
CurrentLocation)
{
ImageName
=
RecordInfo.GetValue(CurrentLocation
-
1
,
1
);
ImageUrl
=
RecordInfo.GetValue(CurrentLocation
-
1
,
0
);
Tc.Controls.Add(
new
LiteralControl(
"
<td width='120' height='120'><a target='_blank' title='
"
+
ImageName
+
"
' href='
"
+
ImageUrl
+
"
'><img border='0' width='100' height='100' src='
"
+
ImageUrl
+
"
'></a></td>
"
));
}
else
j
=
CellCount
+
1
;
}
Tc.Controls.Add(
new
LiteralControl(
"
</tr></table>
"
));
Tr.Cells.Add(Tc);
pic.Rows.Add(Tr);
}
}
相关阅读:
3170: [Tjoi 2013]松鼠聚会
1577: [Usaco2009 Feb]庙会捷运Fair Shuttle
时间管理小强升级记
Lifray Portlet
反面模式
LiferayFAQ(持续更新)
【转载】JRockit检测Tomcat内存溢出JAVA内存泄漏问题
Liferay环境搭建
QQ登陆篇
设计模式MM版
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
oracle>functions
Map集合程序
编程经验总结
oracle>select
JAVA SE 基础部分讲解
java基础小程序
JAVA SE 基础部分小程序
简单购物车
【转】Dcom 的配置
【转】在WINDOWS XP SP2系统中使用OPC的DCOM配置方法
热门文章
系列二:资源管理(概论)
SQL 优化
设计模式零(面向对象基础)
SQL分页小技巧
Python中FITS格式文件数据的读取
3173: [Tjoi2013]最长上升子序列
1293: [SCOI2009]生日礼物
3140: [Hnoi2013]消毒
1188: [HNOI2007]分裂游戏
3175: [Tjoi2013]攻击装置
Copyright © 2020-2023
润新知