调用页面代码...要改进

                    <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;


        }

转载于:https://www.cnblogs.com/sky1982/archive/2008/10/10/1308246.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值