admin/AddExamination.aspx.cs
(开头部分) 5KB这里只显示每个文件的开头 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;
using System.Data.SqlClient;
public partial class admin_AddExamination : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["admin"] == null && Session["teacher"] == null)
{
Response.Redirect("../Login.aspx");
}
if (!IsPostBack)
{
SqlConnection conn = BaseClass.DBCon();
conn.Open();
SqlCommand cmd = new SqlCommand("select * from tb_Lesson", conn);
SqlDataReader sdr = cmd.ExecuteReader();
this.ddlkm.DataSource = sdr;
this.ddlkm.DataTextField = "LessonName";
this.ddlkm.DataValueField = "ID";
this.ddlkm.DataBind();
this.ddlkm.SelectedIndex = 0;
conn.Close();
BindMoKuai();
sdr.Close();
sdr.Dispose();
}
}
protected void btnconfirm_Click(object sender, EventArgs e)
{
if (txtAnsA.Text == "" || txtAnsB.Text == "" || txtAnsC.Text == "" || txtAnsD.Text == "")
{
MessageBox.Show("请将信息填写完整");
return;
}
else
{
string isfb = "";
if (cbFB.Checked == true)
isfb = "1";
else
isfb = "0";
//string str = "insert into tb_test(testContent,testAns1,testAns2,testAns3,testAns4,rightAns,pub,testCourse,SmallTypeId,IsEasy) values('" + txtsubject.Text.Trim() + "','" + txtAnsA.Text.Trim() + "','" + txtAnsB.Text.Trim() + "','" + txtAnsC.Text.Trim() + "','" + txtAnsD.Text.Trim() + "','" + rblRightAns.SelectedValue.ToString() + "','" + isfb + "','" + ddlkm.SelectedItem.Text + "'," + MoKuaiList.SelectedValue + "," + RadioButtonList1.SelectedValue + ")";
string str = "insert into tb_test(testContent,testAns1,testAns2,testAns3,testAns4,rightAns,pub,testCourse,SmallTypeId,IsEasy,jiexi,rad) values(@content,@an1,@an2,@an3,@an4,@ran,@pub,@test,@stype,@iseasy,@jiexi,@rad)";
SqlParameter[] sp = new SqlParameter[12];
if (Request["rdo_jgtype"].ToString() == "1")//编辑器
{
if (FCKeditor1.Value == "")
{
MessageBox.Show("请填写试题题目");
return;
后面还有 64 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
