ASP.NET学生信息管理系统(10)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-11-02 点击数:29656

计算机毕业设计介绍:

(2)xsEdit(学生信息编辑)
此页面可以对学生信息维护,添加、修改操作。添加时,判断学号是否为空、重复,输入学生名称、年龄,选择学生性别和所在班级。如图:
计算机毕业论文

以下是引用片段:

private void Page_Load(object sender, System.EventArgs e)
  {
   // 在此处放置用户代码以初始化页面
   if(!Page.IsPostBack)
   {
    //绑定班级选择框
    this.DropDownList2.DataTextField="bjmc";
    this.DropDownList2.DataValueField="bjid";
    this.DropDownList2.DataSource=DB.Get_Table("select * from bj where xyid=" +((User)Session["User"]).xyid );
    this.DropDownList2.DataBind();
    if(Request.QueryString["Flag"]=="Add")
    {
     //清空控件
     this.txtID.Text="";
     this.txtXm.Text="";
     this.TextBox1.Text="20";
    }
    else
    {
     //显示当前的学生
     DataTable tmprs=new DataTable();
     tmprs=DB.Get_Table("select * from xs where id='" + Request.QueryString["ID"]+"'");
     if(tmprs.Rows.Count>0 )
     {
      this.txtID.Text=tmprs.Rows[0]["id"].ToString();
      this.txtXm.Text=tmprs.Rows[0]["Xsmc"].ToString();
      if (tmprs.Rows[0]["Xsxb"].ToString()=="男")
      {
       this.DropDownList1.SelectedIndex  =0;
      }
      else
      {
       this.DropDownList1.SelectedIndex  =1;
      }
      this.TextBox1.Text =tmprs.Rows[0]["Xsnl"].ToString();
      this.DropDownList2.SelectedValue=tmprs.Rows[0]["bjid"].ToString();
      this.txtID.Enabled=false;
     }
    }
   }

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第11页为计算机毕业论文学生成绩编辑功能介绍......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网