📄 showreport.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class student_ShowReport : System.Web.UI.Page
{
public int allpage=10;
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session["Student"].ToString() != "true")
{
Response.Write("<script>parent.window.href=\"../login.aspx\"</script>");
Response.End();
}
}
catch
{
Response.Write("<script>parent.window.href=\"../login.aspx\"</script>");
Response.End();
}
if (!IsPostBack)
{
Student.Student stu = new Student.Student();
DataTable reader = stu.GetReportInfo();
if (reader != null)
allpage = reader.Rows.Count;
else allpage = 0;
}
}
public void PrintReport()
{
int pageid = 0;
try
{
pageid = Convert.ToInt32( Request["pageid"]);
}
catch (Exception ex)
{
Response.Write("<script> alert(\'" + ex.Message + "\')</script>");
}
try
{
Student.Student stu = new Student.Student();
DataTable reader = stu.GetReportInfo();
if (reader != null)
{
for(int i=pageid*10,j=0;i<reader.Rows.Count&&j<10;i++,j++)
{
DataRow drow = reader.Rows[i];
Response.Write("<tr>");
Response.Write("<td width=\"20%\" align=right class=mode4 style=\"height: 23px\">学术报告题目:</td>");
Response.Write("<td width=\"72%\" align=left class=mode5 style=\"height: 23px\"><div align=\"center\">" + drow ["ReportName"].ToString() + "</div></td>");
Response.Write("<td width=\"8%\" align=left class=mode5 style=\"height: 23px\"><div align=\"center\"><a href=\"#\" OnClick=\"showModalDialog('lerningreport.aspx?reportid=" + drow["ReportID"].ToString() + "',' ','dialogHeight:490px;dialogWidth:650px')\">查看</a></div></td>");
Response.Write("</tr>");
}
page_1.Text = "当前是第" + pageid.ToString() + "页";
allpage = reader.Rows.Count / 10 + 1;
page_all.Text = "共" + Convert.ToString(allpage) + "页";
}
}
catch (Exception ex)
{
Response.Write("<script> alert(\'"+ex.Message+"\')</script>");
}
}
public void PrintPage()
{
for (int i = 0; i < allpage; i++)
{
Response.Write("<a href=ShowReport.aspx?pageid=" + i.ToString() + ">" + i.ToString() + " </a>\n");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -