protected void AProSureButton_Click(object sender, EventArgs e) { Problem Apro = new Problem(); Apro.assignment = int.Parse(Request.QueryString["Assignmentid"].ToString()); Apro.title = AProtitleTextBox.Text; Apro.descrip = AProdescriTextBox.Text; Apro.score = float.Parse(scoreTextBox.Text); ProMan.create(Apro); Response.Redirect("OneAssignment.aspx?Assignmentid=" + Request.QueryString["Assignmentid"] + "&Assignmentnum=" + Request.QueryString["Assignmentnum"]); }
//保存此次作业 protected void ProblemsSaveButton_Click(object sender, EventArgs e) { //将问题存入数据库 problems = (List <Problem>)Session["problems"]; if (problems.Count == 0) { NoProblemLabel.Visible = true; } else { foreach (Problem Apro in problems) { ProMan.create(Apro); } Response.Redirect("AllAssignment.aspx?Coursenum=" + Request.QueryString["Coursenum"]); } }