日期:2014-05-17 浏览次数:20728 次
//分页事件
protected void aspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
aspNetPager.CurrentPageIndex = e.NewPageIndex;
dataBind();
}
aspNetPager.PageSize = PageSize;
PageIndex = aspNetPager.CurrentPageIndex;
ITarticleBusiness tarticleBusiness = factory.GetTarticleBusiness();
ITlmBusiness tlmBusiness = factory.GetTlmBusiness();
//设置gv
string author = txtAuthor.Text.Trim();
string title = txtTitle.Text.Trim();
string lmid = ddlTlm.SelectedValue;//所属栏目
string state = ddlState.SelectedValue;
IList<Varticle> tarticleList = tarticleBusiness.getAllView(author, title, lmid, state, PageIndex, PageSize, out RecordCount);
aspNetPager.RecordCount = RecordCount;//总记录数
if (RecordCount <= 0) aspNetPager.CurrentPageIndex = 1;
bool hasRecord = tarticleList.Count > 0;
//没有数据
if (!hasRecord) { tarticleList.Add(new Varticle()); }
gv.DataSource = tarticleList;
gv.DataBind();
if (!hasRecord)