📄 stu_grade.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.Data.SqlClient;
public partial class studentdetail : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Btn_look;
SqlConnection connections;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["user_id"] == null)
{
Response.Redirect("default.aspx");
}
this.Title = "曙光学校教务管理系统";
lbtnGrade.Enabled = false;
string connsql = System.Configuration.ConfigurationManager.AppSettings["connstring"];
connections = new SqlConnection(connsql);
string str = "select tabcour.Crname,tabstu_cour.Crid,Cryear,Score,Crcre,Crkind from tabstu_cour,tabcour where tabstu_cour.Crid=tabcour.Crid and Sid='" + Session["User_id"].ToString() + "'";
connections.Open();
SqlDataAdapter da = new SqlDataAdapter(str, connections);
DataSet dstr = new DataSet();
da.Fill(dstr);
DataGrid1.DataSource = dstr;
DataGrid1.DataBind();
connections.Close();
}
public void DataGrid_Page(object sender, DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
string connsql = System.Configuration.ConfigurationManager.AppSettings["connstring"];
connections = new SqlConnection(connsql);
string str = "select tabcour.Crname,tabstu_cour.Crid,Cryear,Score,Crcre,Crkind from tabstu_cour,tabcour where tabstu_cour.Crid=tabcour.Crid and Sid='" + Session["User_id"].ToString() + "'";
connections.Open();
SqlDataAdapter da = new SqlDataAdapter(str, connections);
DataSet dstr = new DataSet();
da.Fill(dstr);
DataGrid1.DataSource = dstr;
DataGrid1.DataBind();
}
protected void lbtnQuit_Click(object sender, EventArgs e)
{
Session.Clear();
Response.Redirect("Default.aspx");
}
protected void lbtnRepwd_Click(object sender, EventArgs e)
{
Response.Redirect("repassword.aspx");
}
protected void lbtnCourse_info_Click(object sender, EventArgs e)
{
Response.Redirect("stu_course.aspx");
}
protected void lbtnStuInfo_Click(object sender, EventArgs e)
{
Response.Redirect("stu_info.aspx");
}
protected void lbtnChoose_Click(object sender, EventArgs e)
{
Response.Redirect("choosecourse.aspx");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -