Teacher/inputstudentscore.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
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;
public partial class inputstudentscore : System.Web.UI.Page
{
CommDB mydb = new CommDB();
DataSet myds = new DataSet();
string mysql;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
mysql = "SELECT cno FROM course WHERE tno='" + Session["uno"] + "'";
myds = mydb.ExecuteQuery(mysql, "course");
if (myds.Tables["course"].Rows.Count > 0)
{
DropDownList1.DataSource = myds.Tables["course"];
DropDownList1.DataTextField = "cno";
DropDownList1.DataBind();
}
else
Response.Redirect("~/dispinfo.aspx?info=没有安排任何上课课程!");
Button2.Visible = false;
Button3.Visible = false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string mysql;
mysql = "SELECT * FROM score WHERE tno='" + Session["uno"] + "'AND cno ='" + DropDownList1.SelectedValue + "' ORDER BY sno";
myds = mydb.ExecuteQuery(mysql, "score");
if (myds.Tables["score"].Rows.Count > 0)
{
GridView1.DataSource = myds.Tables["score"];
GridView1.DataBind();
Button2.Visible = true;
Button3.Visible = true;
}
else
Response.Write("<script>alert('没有学生选修或提交该课程!')</script>");
}
protected void Button2_Click(object sender, EventArgs e)
{ //保存成绩
savedata();
Response.Redirect("~/dispinfo.aspx?info=输入的成绩已保存!");
}
protected void savedata() //保存成绩过程
{
string no;
TextBox txtbh;
int i;
后面还有 16 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
