⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addstudy.aspx.cs

📁 一个研究生管理系统 具体的情况自己看了
💻 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;

public partial class student_addstudy : System.Web.UI.Page
{
    public int allpage = 1;
    public int currentpage = 0;
    public DataTable dt = null;
    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 (Student.Student.IsReStudyCourseValid())
            {
                try
                {
                    try
                    {
                        currentpage = Convert.ToInt32(Request["pageid"].ToString());
                    }
                    catch
                    { }
                    dt = Student.Student.GetReStudyCourseValid();
                    if (dt != null)
                    {
                        allpage = dt.Rows.Count / 20 + 1;
                        page_all.Text = "共" + allpage.ToString() + "页";
                        page_1.Text = "当前第" + currentpage.ToString() + "页";
                    }
                    else
                    {
                        page_all.Text = "共" + allpage.ToString() + "页";
                        page_1.Text = "当前第" + currentpage.ToString() + "页";
                    }
                }
                catch/*Exception ex*/
                {

                }
            }
            else
            {
                Response.Write("<script> alert('补修课程申请已经结束!!');</script>");
                titletext.Enabled = false;
                add.Enabled = false;
                delete.Enabled = false;

            }

    }
    public void PrintReStudyCourse()
    {
        try
        {
            if (dt != null)
            {

                for (int i = currentpage * 20, j = 0; i < dt.Rows.Count && j < 20; i++, j++)
                {

                    Response.Write("<tr>");
                    Response.Write("<td align=\"center\" class=\"mode5\" height=\"35\" style=\"width: 118px\">");
                    Response.Write(dt.Rows[i]["ReStudyCourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" height=\"35\" class=\"mode5\" style=\"width: 142px\">");
                    Response.Write(dt.Rows[i]["CourseName"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 126px\">");
                    Response.Write(dt.Rows[i]["Teacher"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 119px\">");
                    Response.Write(dt.Rows[i]["CourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 110px\">");
                    Response.Write(dt.Rows[i]["TeaClassID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\">");
                    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>");
        }
    }
    public void PrintPage()
    {
        for (int i = 0; i < allpage; i++)
        {
            Response.Write("<a href=addstudy.aspx?pageid=" + i.ToString() + ">" + i.ToString() + "&nbsp</a>\n");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            if (titletext.Text.Trim() != "")
            {
                if (!Student.Student.HasStuAppliedReStudyCourse(Session["StuID"].ToString(), Convert.ToInt32(titletext.Text.Trim())))
                {
                    if (Student.Student.SetRestStudyApply(Session["StuID"].ToString(), Convert.ToInt32(titletext.Text.Trim())))
                    {
                        Response.Write("<script> alert('补修课程申请提交成功');</script>");
                    }
                    else
                    {
                        Response.Write("<script> alert('补修课程申请提交失败');</script>");
                    }

                }
                else
                {
                    Response.Write("<script> alert('您已经申请过该课程');</script>");
                }
            }
            else
            {
                Response.Write("<script> alert('补修课程序列号不能为空');</script>");
            }
        }
        catch (Exception ex)
        {
            Response.Write("<script> alert(\'" + ex.Message + "\');</script>");
        }


    }
    protected void delete_Click(object sender, EventArgs e)
    {
        try
        {
            if (titletext.Text.Trim() != "")
            {
                if (!Student.Student.HasStuAppliedReStudyCourse(Session["StuID"].ToString(), Convert.ToInt32(titletext.Text.Trim())))
                {

                    Response.Write("<script> alert('您还未申请过该补修课程');</script>");

                }
                else
                {

                    if (Student.Student.DeleteRestStudyApply(Session["StuID"].ToString(), Convert.ToInt32(titletext.Text.Trim())))
                    {
                        Response.Write("<script> alert('补修课程申请删除成功成功');</script>");
                    }
                    else
                    {
                        Response.Write("<script> alert('补修课程申请删除失败');</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script> alert('补修课程序号不能为空');</script>");
            }
        }
        catch (Exception ex)
        {
            Response.Write("<script> alert(\'" + ex.Message + "\');</script>");
        }


    }
    public void PrintReStudyCourseSuccess_Failure_Doing_Current()
    {
        try
        {
            DataTable dt = Student.Student.GetReStudyCourseSuccess_Failure_Doing_Current(Session["StuID"].ToString());
            if (dt != null)
            {

                for (int i =0; i < dt.Rows.Count ; i++)
                {

                    Response.Write("<tr>");
                    Response.Write("<td align=\"center\" class=\"mode5\" height=\"35\" style=\"width: 118px\">");
                    Response.Write(dt.Rows[i]["ReStudyCourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" height=\"35\" class=\"mode5\" style=\"width: 142px\">");
                    Response.Write(dt.Rows[i]["CourseName"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 126px\">");
                    Response.Write(dt.Rows[i]["Teacher"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 119px\">");
                    Response.Write(dt.Rows[i]["CourseID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\" style=\"width: 110px\">");
                    Response.Write(dt.Rows[i]["TeaClassID"].ToString());
                    Response.Write("</td>");
                    Response.Write("<td align=\"center\" class=\"mode5\">");
                    Response.Write("<a href=\"#\" OnClick=\"showModalDialog('seerestudycoursedid.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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -