private void GetInfoVideo() { long CurrentPage = Convert.ToInt64(this.AspNetPager.CurrentPageIndex); long PageNum = Convert.ToInt64(this.AspNetPager.PageSize); long TotalCount = 0; long PageCount = 1; string MerchantDomain = (string)ConfigurationManager.AppSettings["MerchantDomain"]; Tz888.BLL.TPVideo srvSI = new Tz888.BLL.TPVideo(); DataSet ds = srvSI.dsGetVideoMess("*", ViewState["Criteria"].ToString(), "publishT desc", CurrentPage, PageNum, out TotalCount); DataTable dtdata = MakeTable(); foreach (DataRow dr in ds.Tables[0].Rows) { DataRow drs = dtdata.NewRow(); drs["InfoID"] = dr["InfoID"].ToString(); drs["href"] = MerchantDomain + "/videodetails.aspx?id=" + dr["InfoID"].ToString(); drs["Title"] = dr["Title"].ToString(); drs["GradeID"] = dr["GradeID"].ToString(); drs["publishT"] = dr["publishT"].ToString(); drs["LoginName"] = dr["LoginName"].ToString(); drs["Origin"] = dr["Origin"].ToString(); drs["IsCore"] = dr["IsCore"].ToString(); drs["AuditingStatusDesc"] = dr["AuditingStatusDesc"].ToString(); dtdata.Rows.Add(drs); } this.AspNetPager.RecordCount = Convert.ToInt32(TotalCount); GridView1.DataSource = dtdata.DefaultView; this.GridView1.DataBind(); if (TotalCount % PageNum > 0) { PageCount = TotalCount / PageNum + 1; } else { PageCount = TotalCount / PageNum; } this.pinfo.InnerText = "共" + PageCount + "页"; this.LblCount.Text = TotalCount.ToString(); if (ds.Tables[0].Rows.Count <= 0) { this.NoMessage.Style.Value = "display:block"; this.dvCheck.Style.Value = "display:none"; this.pinfo2.Style.Value = "display:none"; } else { this.NoMessage.Style.Value = "display:none"; this.dvCheck.Style.Value = "display:block"; this.pinfo2.Style.Value = "display:block"; } }
private void GetInfoVideo() { long CurrentPage = Convert.ToInt64(this.AspNetPager.CurrentPageIndex); long PageNum = Convert.ToInt64(this.AspNetPager.PageSize); long TotalCount = 0; long PageCount = 1; Tz888.BLL.TPVideo srvSI = new Tz888.BLL.TPVideo(); DataSet ds = srvSI.dsGetVideoMess("*", ViewState["Criteria"].ToString(), "publishT desc", CurrentPage, PageNum, out TotalCount); this.AspNetPager.RecordCount = Convert.ToInt32(TotalCount); GridView1.DataSource = ds.Tables[0].DefaultView; this.GridView1.DataBind(); if (TotalCount % PageNum > 0) { PageCount = TotalCount / PageNum + 1; } else { PageCount = TotalCount / PageNum; } this.pinfo.InnerText = "共" + PageCount + "页"; this.LblCount.Text = TotalCount.ToString(); if (ds.Tables[0].Rows.Count <= 0) { this.NoMessage.Style.Value = "display:block"; this.dvCheck.Style.Value = "display:none"; this.pinfo2.Style.Value = "display:none"; } else { this.NoMessage.Style.Value = "display:none"; this.dvCheck.Style.Value = "display:block"; this.pinfo2.Style.Value = "display:block"; } }