index.aspx.cs
上传用户:ah_jiwei
上传日期:2022-07-24
资源大小:54044k
文件大小:4k
源码类别:

数据库编程

开发平台:

Visual C++

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.SqlClient;
  12. public partial class student_index : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         string userId = Session["userId"].ToString();
  17.         //string userId = "63091500002";
  18.         //论文查询
  19.         string keyan = Label1.Text.ToString().Trim();
  20.         string qiye = Label2.Text.ToString().Trim();
  21.         string xuanbao = Label3.Text.ToString().Trim();
  22.         string kaiti = Label4.Text.ToString().Trim();
  23.         string lunwen = Label5.Text.ToString().Trim();
  24.         
  25.         SqlConnection connection = DB.connect_la();
  26.         connection.Open();
  27.         string commandString = "SELECT * FROM thsis_data WHERE stu_id= " + userId;
  28.         SqlCommand cmd = new SqlCommand(commandString, connection);
  29.         SqlDataReader sdr = cmd.ExecuteReader();
  30.         string thesis_exist = "未提交";
  31.         if (sdr.Read())
  32.         {
  33.             Label1.Text = sdr.GetValue(3).ToString();
  34.             if (Label1.Text.Trim() == "未提交")
  35.             {
  36.                 HyperLink1.NavigateUrl = "../document/科研实践能力考核表.doc";
  37.             }
  38.             else if(Label1.Text.Trim() == "已提交")
  39.             {
  40.                 HyperLink1.NavigateUrl = "../document/" + userId + "/科研实践能力考核表.doc";
  41.             }
  42.             Label2.Text = sdr.GetValue(4).ToString();
  43.             if (Label2.Text.Trim() == "未提交")
  44.             {
  45.                 HyperLink2.NavigateUrl = "../document/企业导师表.doc";
  46.             }
  47.             else if (Label2.Text.Trim() == "已提交")
  48.             {
  49.                 HyperLink2.NavigateUrl = "../document/" + userId + "/企业导师表.doc";
  50.             }
  51.             Label3.Text = sdr.GetValue(2).ToString();
  52.             if (Label3.Text.Trim() == "未提交")
  53.             {
  54.                 HyperLink3.NavigateUrl = "../document/选报导师表.doc";
  55.             }
  56.             else if (Label3.Text.Trim() == "已提交")
  57.             {
  58.                 HyperLink3.NavigateUrl = "../document/" + userId + "/选报导师表.doc";
  59.             }
  60.             Label4.Text = sdr.GetValue(1).ToString();
  61.             if (Label4.Text.Trim() == "未提交")
  62.             {
  63.                 HyperLink4.NavigateUrl = "../document/开题报告.doc";
  64.             }
  65.             else if (Label4.Text.Trim() == "已提交")
  66.             {
  67.                 HyperLink4.NavigateUrl = "../document/" + userId + "/开题报告.doc";
  68.             }
  69.             thesis_exist = sdr.GetValue(5).ToString();
  70.         }
  71.         sdr.Close();
  72.         commandString = "SELECT thesis_state,thesis_total FROM thesis where stu_id=" + userId;
  73.         SqlCommand cmd2 = new SqlCommand(commandString, connection);
  74.         SqlDataReader sdr2 = cmd2.ExecuteReader();
  75.         if (sdr2.Read())
  76.         {
  77.             Label5.Text = sdr2.GetValue(0).ToString();
  78.             string thesis_title = sdr2.GetValue(1).ToString();
  79.             if (thesis_exist.Trim() == "未提交")
  80.             {
  81.                 HyperLink5.NavigateUrl = "../document/关于Java的生存现状之分析.doc";
  82.             }
  83.             else if (thesis_exist.Trim() == "已提交")
  84.             {
  85.                 HyperLink5.NavigateUrl = "../document/" + userId + "/"+thesis_title+".doc";
  86.             }
  87.         }
  88.         sdr2.Close();
  89.         connection.Close();
  90.     }
  91. }