nethoutai/Exam.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;
using CommonLib;
using DBUtility;
public partial class admin_Exam : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["id"].ToString() != null)
        {
            SqlHelper.BindGridview(GridView1, SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, "select *from T_Exams where ChapterId='" + Request.QueryString["id"].ToString()+ "'", null);
        }
    }
   
    
    protected void Button1_Click1(object sender, EventArgs e)
    {
        string qwe, anw1, anw2, anw3, anw4, anw;
        qwe = TextBox2.Text;
        anw1 = TextBox3.Text;
        anw2 = TextBox7.Text;
        anw3 = TextBox4.Text;
        anw4 = TextBox5.Text;
        anw = TextBox6.Text;
        SqlConnection conn = new DBCon().getCon();
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = conn;
        cmd.CommandText = "insert into  T_Exams(ExamQue,A,B,C,D,ExamAns,ChapterId)values('" + qwe + "','" + anw1 + "','" + anw2 + "','" + anw3 + "','" + anw4 + "','" + anw + "','"+Request.QueryString["id"].ToString()+"')";
        int i = cmd.ExecuteNonQuery();
        if (i > 0)
        {
            JavaScriptHelper.Alert("添加成功");
            TextBox2.Text = "";
            TextBox3.Text = "";
            TextBox4.Text = "";
            TextBox5.Text = "";
            TextBox6.Text = "";
            TextBox7.Text = "";
        }
        else
        {
            JavaScriptHelper.Alert("添加失败");

        }
        SqlHelper.BindGridview(GridView1, SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, "select *from T_Exams where ChapterId='" + Request.QueryString["id"].ToString()+ "'", null);
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        
        string a,b,c,d,m,f,g;
        a = ((Label)GridView1.Rows[e.NewEditIndex].Cells[0].FindControl("Label1")).Text;
后面还有 78 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。