📄 xuejiquery.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.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(" ");
}
}
public void ShowStuGender()//性 别
{
try
{
Response.Write(drow["Gender"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuBirthday()//出生日期
{
try
{
Response.Write(drow["Birthday"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuPoliticsVisage()//政治面貌
{
try
{
Response.Write(drow["PoliticsVisage"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuNation()//民族
{
try
{
Response.Write(drow["Nation"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuNativePlace()//籍贯
{
try
{
Response.Write(drow["NativePlace"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuEntranceTime()//入学时间
{
try
{
Response.Write(drow["EntranceTime"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuRegisteredPermanentResidence()//户口所在地
{
try
{
Response.Write(drow["RegisteredPermanentResidence"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuduty()//职称或职务
{
try
{
Response.Write(drow["Duty"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuBirthPlace()//出 生 地
{
//暂时无
Response.Write(" ");
}
public void ShowStuIDCard()//身份证号
{
try
{
Response.Write(drow["IDCard"].ToString());
}
catch
{
Response.Write(" ");
}
}
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(" ");
}
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(" ");
}
}
public void ShowStuserial_number()//统一编号
{
//暂时无
Response.Write(" ");
}
public void ShowStuID()//学 号
{
try
{
Response.Write(drow["StuID"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuType()//学生类型;
{
try
{
Response.Write(drow["Type"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuCollege()//暂时无
{
//暂时无
Response.Write(" ");
}
public void ShowStuDirection()//方 向
{
try
{
Response.Write(drow["Direction"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuSpvName()//导 师
{
try
{
Response.Write(drow["SpvName"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuSubjectType()//学科类别
{
//暂时无
Response.Write(" ");
}
public void ShowStuLanguage()//外语语种
{
//暂时无
Response.Write(" ");
}
public void ShowStuYear()//学制
{
//暂时无
Response.Write(" ");
}
public void ShowStuTakeCar()//乘车区间
{
//暂时无
Response.Write(" ");
}
public void ShowStuZipCode()//邮政编码
{
try
{
Response.Write(drow["ZipCode"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuStudyDegree()//攻读学位
{
//暂时无
Response.Write(" ");
}
public void ShowStuSpecial()//专业
{
//暂时无
Response.Write(" ");
}
public void ShowStuGrade()//年级
{
try
{
Response.Write(drow["Grade"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuLanguagegrade()//外语成绩
{
//暂时无
Response.Write(" ");
}
public void ShowStuTrainMode()//培养方式:
{
try
{
Response.Write(drow["TrainMode"].ToString());
}
catch
{
Response.Write(" ");
}
}
public void ShowStuRemark()//备注
{
try
{
Response.Write(drow["StuRemark"].ToString());
}
catch
{
Response.Write(" ");
}
}
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 + -