📄 flow_monitor.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration ;
using System.Data .OleDb ;
using System.Data.SqlClient ;
namespace graduate.stu
{
/// <summary>
/// flow_monitoe 的摘要说明。
/// </summary>
public class flow_monitor : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label11;
protected System.Web.UI.HtmlControls.HtmlTable table_search;
protected System.Web.UI.WebControls.DataGrid dg_flow;
string myConnString=ConfigurationSettings.AppSettings ["SQLconnectionString"];
string sql="",studentid="";
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
studentid = Convert.ToString (Session["studentid"]);
if(!IsPostBack)
{
SqlConnection conn = new SqlConnection(myConnString);
sql="SELECT email,teachername,SubjectName, BuildReportFlag, BuildReportFlag , SelectCensorFlag, MissionListFlag, AdviserCommentFlag, MidCheckListFlag,ReviewerCommentFlag, TranslationFlag,CodeCommitFlag, PaperCommitFlag FROM BYSJ.FlowMonitor a ,BYSJ.SureSubject b ,BYSJ.SubmitSubject c,bysj.teacherbaseinfo d where a.SureSubjectID = b.SureSubjectID and b.SubjectID = c.SubjectID and b.StudentID = '"+studentid+"' and c.teacherid=d.teacherid";
try
{
conn.Open();
SqlDataAdapter adapter= new SqlDataAdapter(sql, conn);
DataSet cla=new DataSet ();
adapter.Fill(cla);
if(cla.Tables ["table"].Rows .Count !=0)
{
dg_flow.DataSource =cla;
dg_flow.DataBind ();
}
else
{
Response.Write ("<script>");
Response.Write ("alert('没有数据!')");
Response.Write ("</script>");
}
}
catch(SqlException ex)
{
Response.Write ("<script>");
Response.Write ("alert('数据库连接出错!')");
Response.Write ("</script>");
}
finally
{
conn.Close ();
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public string FormatString (string str)
{
if (str=="1")
str = "完成";
else
str = "未完成";
return str;
}
public string Formatmail(string str)
{
str="mailto:"+str;
return str;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -