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

📄 xuejiquery.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;
using System.Xml;

public partial class student_xuejiquery : System.Web.UI.Page
{
    private XmlDocument xmld;
    public DataRow drow = 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();
        }
        try
        {
            xmld = new XmlDocument();
            xmld.Load(Server.MapPath(@"../App_Data/PeiYangFangAn.xml"));
        }
        catch//(Exception exp)
        {
            Response.Write("数据打开失败,请与管理员联系");
            Response.End();
        }
        int i = -1;
        XmlNodeList xnl = xmld.SelectSingleNode("data").ChildNodes;
        foreach (XmlNode xn in xnl)
        {
            XmlElement xe = (XmlElement)xn;
            if (xe.GetAttribute("name") == "peiyang")
            {

                HyperLink1.NavigateUrl ="../UpLoad/" + xe.GetAttribute("value");
                
               // HyperLink1.NavigateUrl=
                i = 1;
                break;
            }
        }
        try
        {
            drow = Student.Student.GetAllInfoFromStudentInfoAndSpvInfo(Session["StuID"].ToString());
        }
        catch (Exception ex)
        {
            Response.Write("<script> alert(\'" + ex.Message + "\');</script>");
        }
       
        if (!IsPostBack)
        {
            TxtDomitory.Enabled = false;
            TxtDomitoryPhone.Enabled = false;
            TxtPhone.Enabled = false;
            TxtE_mail.Enabled = false;
            Button2.Enabled = false;
            ShowStudormitory();
            ShowStudormitoryPhone();
            ShowStuPrimTeachPhone();
            ShowStuEmail();
            
        }
    }
    public void ShowStuName()
    {
        try
        {
            Response.Write(drow["StuName"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuGender()//性    别
    {

        try
        {
            Response.Write(drow["Gender"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuBirthday()//出生日期
    {
        try
        {
            Response.Write(drow["Birthday"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuPoliticsVisage()//政治面貌
    {
        try
        {
            Response.Write(drow["PoliticsVisage"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuNation()//民族
    {
        try
        {
            Response.Write(drow["Nation"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuNativePlace()//籍贯
    {
        try
        {
            Response.Write(drow["NativePlace"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuEntranceTime()//入学时间
    {
        try
        {
            Response.Write(drow["EntranceTime"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuRegisteredPermanentResidence()//户口所在地
    {
        try
        {
            Response.Write(drow["RegisteredPermanentResidence"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuduty()//职称或职务
    {
        try
        {
            Response.Write(drow["Duty"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuBirthPlace()//出 生 地
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuIDCard()//身份证号
    {
        try
        {
            Response.Write(drow["IDCard"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStudormitory()//寝 室 号
    {
        try
        {
           
             TxtDomitory.Text = drow["Dormitory"].ToString();
            
            
        }
        catch
        {
            TxtDomitory.Text = " ";

        }
    }
    public void ShowStudormitoryPhone()//寝室电话
    {
        try
        {

            TxtDomitoryPhone.Text = drow["DormitoryPhone"].ToString();
            
        }
        catch
        {
            TxtDomitory.Text = " ";

        }
    }
    public void ShowStuPrimTeachPhone()//联系电话
    {
        try
        {
            TxtPhone.Text = drow["PrimTeachPhone"].ToString();
            
        }
        catch
        {
            TxtPhone.Text = " ";

        }
    }
    public void ShowStuMarry()//婚姻状况
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuEmail()//E-mail
    {
        try
        {
           
             TxtE_mail.Text = drow["E_mail"].ToString();

            
        }
        catch
        {
            TxtPhone.Text = " ";

        }
    }
    public void ShowStuAddress()//家庭地址
    {
        try
        {
            Response.Write(drow["Address"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuserial_number()//统一编号
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuID()//学    号
    {
        try
        {
            Response.Write(drow["StuID"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuType()//学生类型;
    {
        try
        {
            Response.Write(drow["Type"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuCollege()//暂时无
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuDirection()//方    向
    {
        try
        {
            Response.Write(drow["Direction"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuSpvName()//导    师
    {
        try
        {
            Response.Write(drow["SpvName"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuSubjectType()//学科类别
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuLanguage()//外语语种
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuYear()//学制
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuTakeCar()//乘车区间
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuZipCode()//邮政编码
    {
        try
        {
            Response.Write(drow["ZipCode"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuStudyDegree()//攻读学位
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuSpecial()//专业
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuGrade()//年级
    {
        try
        {
            Response.Write(drow["Grade"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuLanguagegrade()//外语成绩
    {
        //暂时无
        Response.Write("&nbsp");
    }
    public void ShowStuTrainMode()//培养方式:
    {
        try
        {
            Response.Write(drow["TrainMode"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    public void ShowStuRemark()//备注
    {
        try
        {
            Response.Write(drow["StuRemark"].ToString());
        }
        catch
        {
            Response.Write("&nbsp");

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TxtDomitory.Enabled = true;
        TxtDomitoryPhone.Enabled = true;
        TxtPhone.Enabled = true;
        TxtE_mail.Enabled = true;
        Button2.Enabled = true;
        ShowStudormitory();
        ShowStudormitoryPhone();
        ShowStuPrimTeachPhone();
        ShowStuEmail();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if(TxtDomitory.Text.Trim()==""||TxtDomitoryPhone.Text.Trim()==""||TxtPhone.Text.Trim()==""||TxtE_mail.Text.Trim()=="")
        {
            Response.Write("<script> alert('请将信息填写完整!!!');</script>");
        }
        else if (!TxtE_mail.Text.Trim().Contains("@"))
        {
            Response.Write("<script> alert('E_mail地址不合法!!!');</script>");
        }
        else
        {
            if(Student.Student.UpdateStudentInfo(Session["StuID"].ToString(),TxtDomitory.Text.Trim(),TxtDomitoryPhone.Text.Trim(),TxtPhone.Text.Trim(),TxtE_mail.Text.Trim()))
            {
                try
                {
                    drow = Student.Student.GetAllInfoFromStudentInfoAndSpvInfo(Session["StuID"].ToString());
                }
                catch (Exception ex)
                {
                    Response.Write("<script> alert(\'" + ex.Message + "\');</script>");
                }
                ShowStudormitory();
                ShowStudormitoryPhone();
                ShowStuPrimTeachPhone();
                ShowStuEmail();
                Response.Write("<script> alert('修改成功');</script>");

            }
            else 
            {
                 Response.Write("<script> alert('修改失败');</script>");
            }
        }

    }
}

⌨️ 快捷键说明

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