addstudy_history.aspx.cs

来自「一个研究生管理系统 具体的情况自己看了」· CS 代码 · 共 70 行

CS
70
字号
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;

public partial class student_addstudy_history : System.Web.UI.Page
{
    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();
        }

    }
    public void PrintAllReStudyInfo()
    {
        try
        {
            DataTable dt = Student.Student.GetAllReStudyInfoHistory(Session["StuID"].ToString());
            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Response.Write("<tr>");
                    Response.Write("<td align=\"right\" class=\"mode4\" style=\"width: 18%; height: 23px; text-align: center\">");
                    Response.Write(dt.Rows[i]["ReStudyCourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"right\" class=\"mode4\" style=\"width: 30%; height: 23px; text-align: center\">");
                    Response.Write(dt.Rows[i]["CourseName"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"right\" class=\"mode4\" style=\"height: 23px; width: 16%; text-align: center;\">");
                    Response.Write(dt.Rows[i]["Teacher"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"left\" class=\"mode4\" style=\"width: 13%; height: 23px; text-align: center\">");
                    Response.Write(dt.Rows[i]["CourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"left\" class=\"mode4\" style=\"width: 11%; height: 23px; text-align: center\">");
                    Response.Write(dt.Rows[i]["TeaClassID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"left\" class=\"mode4\" style=\"height: 23px; text-align: center; width: 29%;\">");
                    Response.Write("<a href=\"#\" OnClick=\"showModalDialog('seerestudycourse.aspx?restudycourseid=" + dt.Rows[i]["ReStudyCourseID"].ToString() + "','','dialogHeight:490px;dialogWidth:650px')\">查看</a>");
                    Response.Write("</td>");
                    Response.Write("</tr>");
                }
            }

        }
        catch (Exception ex)
        {
            Response.Write("<script> alert(\'" + ex.Message + "\');</script>");
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?