void bindlikedata(int pi, int ps, commtypeEntity custinfo) { this.Repeater1.DataSource = cusinfoBll.getCustominfom("", pi, ps, custinfo); this.Repeater1.DataBind(); int pagecount = cusinfoBll.Getcustinfocountm("", custinfo); this.AspNetPager1.PageSize = pageSize; this.AspNetPager1.RecordCount = pagecount; this.AspNetPager1.CustomInfoHTML = "总:" + AspNetPager1.RecordCount.ToString() + "条,每页:%PageSize%条,当前:%CurrentPageIndex%/%PageCount%"; }
public static DataSet getCustominfom(string mark, int pi, int ps, commtypeEntity custinfo) { string tablename = " comm_type "; string sortfld = " id "; string selecfld = " *"; string PrimaryKey = "id"; int pageindex = pi; int pagesize = ps; int sortType = 1; string strWhere = ""; if (mark == "begin") { strWhere = " type='��ͬ��Ŀ' "; } else { strWhere = " tname like '" + custinfo.Tname + "%' and type='��ͬ��Ŀ' "; } string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
/// <summary> /// /// </summary> /// <param name="mark"></param> /// <param name="custinfo"></param> /// <returns></returns> public static int Getcustinfocountm(string mark, commtypeEntity custinfo) { string strWhere = ""; if (mark == "begin") { strWhere = " type='��ͬ��Ŀ' "; } else { strWhere = " tname like '" + custinfo.Tname + "%' and type='��ͬ��Ŀ' "; } return conString.Getcommentcount("comm_type", "id", strWhere); }