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