⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 insertshiti.aspx.cs

📁 考试系统,包括组试卷,用户管理,角色分配 实现在线考试
💻 CS
📖 第 1 页 / 共 2 页
字号:
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;
//该源码下载自www.51aspx.com(51aspx.com)

public partial class HouAdmin_InsertShiTi : System.Web.UI.Page
{
    Datacon dataconn = new Datacon();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ddlType.SelectedIndex == 0)
        {
            Panel1.Visible = true;
            Panel2.Visible = false;
        }
        else
        {
            Panel1.Visible = false;
            Panel2.Visible = true;
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string sstr1 = Session["drop1"].ToString();
        string sstr2 = Session["drop2"].ToString();
        string sstr3 = Session["drop3"].ToString();
        if (ddlType.SelectedIndex == 0)
        {
            dataconn.eccom("insert into tb_Questions"
                +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" 
                + ddlAnswer.Text + "','" + txtInstruction.Text + "')");
            Response.Redirect("kaoshi_timu.aspx");
        }
        else
        {
            if (cblAnswer.Items[0].Selected == true && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == true && cblAnswer.Items[3].Selected == true)
            {
                string str1 = "A,B,C,D";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str1 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == true && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == true && cblAnswer.Items[3].Selected == false)
            {
                string str2 = "A,B,C";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str2 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == true && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == false && cblAnswer.Items[3].Selected == false)
            {
                string str3 = "A,B";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str3 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == true && cblAnswer.Items[1].Selected == false && cblAnswer.Items[2].Selected == false && cblAnswer.Items[3].Selected == false)
            {
                string str4 = "A";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str4 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == false && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == false && cblAnswer.Items[3].Selected == false)
            {
                string str5 = "B";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str5 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == false && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == true && cblAnswer.Items[3].Selected == false)
            {
                string str6 = "B,C";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str6 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == false && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == false && cblAnswer.Items[3].Selected == true)
            {
                string str7 = "B,D";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str7 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == false && cblAnswer.Items[1].Selected == true && cblAnswer.Items[2].Selected == true && cblAnswer.Items[3].Selected == true)
            {
                string str8 = ",B,C,D";
                dataconn.eccom("insert into tb_Questions"
                    +"(que_professionid,que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,optionD,que_answer,note)"
                    +"values('" + sstr1 + "','" + sstr2 + "','" + sstr3 + "','" + this.txtExamTitle.Text 
                    + "','" + ddlType.Text + "','" + this.txtExamA.Text + "','" + this.txtExamB.Text 
                    + "','" + this.txtExamC.Text + "','" + this.txtExamD.Text + "','" + str8 
                    + "','" + txtInstruction.Text + "')");
                Response.Redirect("kaoshi_timu.aspx");
            }
            if (cblAnswer.Items[0].Selected == true && cblAnswer.Items[1].Selected == false && cblAnswer.Items[2].Selected == false && cblAnswer.Items[3].Selected == true)
            {
                string str9 = "A,D";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -