<webdiyer:AspNetPager
ID="anpPage" runat="server" NextPageText="下一页"
onpagechanged="anpPage_PageChanged" PrevPageText="上一页"
ShowFirstLast="False" AlwaysShow="True" CssClass=""
CurrentPageButtonClass="" CurrentPageButtonStyle="shop_fy"
CurrentPageButtonTextFormatString="[{0}]" PagingButtonSpacing="2px">
</webdiyer:AspNetPager>
<%
foreach (IndexPageProduct p in indexpageproduct)
{ %>
/// <summary>
/// 我型我show查询
/// </summary>
/// <param name="tblName">要显示的表或多个表的连接</param>
/// <param name="fldName">要显示的字段列表</param>
/// <param name="pageSize">每页显示的记录个数</param>
/// <param name="page">要显示那一页的记录</param>
/// <param name="pageCount">查询结果分页后的总页数</param>
/// <param name="Counts">查询到的记录数</param>
/// <param name="fldSort">排序字段列表或条件</param>
/// <param name="Sort">排序方法,0为升序,1为降序(如果是多字段排列Sort指代最后一个排序字段的排列顺序(最后一个排序字段不加排序标记)--程序传参如:' SortA Asc,SortB Desc,SortC ')</param>
/// <param name="strCondition">查询条件,不需where</param>
/// <param name="ID">主表的主键</param>
/// <param name="Dist">是否添加查询字段的 DISTINCT 默认0不添加/1添加</param>
/// <returns></returns>
public IList<Model.MemberPersonInfo> ShowSearchList(string tblName, string fldName, int pageSize, int page, out int pageCount,
out int Counts, string fldSort, int Sort, string strCondition, string ID, int Dist)
{
SqlParameter[] para ={
DbHelperSQL.MakeInParam("@tblName", SqlDbType.NVarChar, 200, tblName),
DbHelperSQL.MakeInParam("@fldName", SqlDbType.NVarChar,500, fldName),
DbHelperSQL.MakeInParam("@pageSize",SqlDbType.Int,4,pageSize),
DbHelperSQL.MakeInParam("@page",SqlDbType.Int,4,page),
DbHelperSQL.MakeOutParam("@pageCount", SqlDbType.Int, 4),
DbHelperSQL.MakeOutParam("@Counts", SqlDbType.Int, 4),
DbHelperSQL.MakeInParam("@fldSort", SqlDbType.NVarChar,200, fldSort),
DbHelperSQL.MakeInParam("@Sort",SqlDbType.Bit,1,Sort),
DbHelperSQL.MakeInParam("@strCondition", SqlDbType.NVarChar, 1000,strCondition),
DbHelperSQL.MakeInParam("@ID", SqlDbType.NVarChar, 150,ID),
DbHelperSQL.MakeInParam("@Dist", SqlDbType.Int, 4,Dist)
};
DataSet ds = DbHelperSQL.RunProcedure("P_ListPage", para, "ds");
pageCount = (int)para[4].Value;
Counts = (int)para[5].Value;
DataTable dt = new DataTable();
if (ds != null)
{
if (ds.Tables.Count > 0)
{
dt = ds.Tables[0];
}
}
IList<Model.MemberPersonInfo> myList = new List<Model.MemberPersonInfo>();
if (dt != null)
{
foreach (DataRow dr in dt.Rows)
{
Model.MemberPersonInfo model = new SHICHAO.Model.MemberPersonInfo();
if (dr["id_MA"].ToString() != "")
{
model.id_MA = int.Parse(dr["id_MA"].ToString());
}
if (dr["img"].ToString() != "")
{
model.img = dr["img"].ToString();
}
model.nicheng = dr["nicheng"].ToString();
model.qianming = dr["qianming"].ToString();
myList.Add(model);
}
}
return myList;
}