Admin1/3uTeacherAdd.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;
using System.Data.SqlClient;
public partial class user_uInfofb : System.Web.UI.Page
{
    SqlOperate sqloperate = new SqlOperate();
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["MName"] == null)
        {
            Class1.AlertShow("请先登录系统!", "../Login.aspx");
            return;
        }
        if (!IsPostBack)
        {
            string sql = "select a1,id from tb_Customer ";

            DropDownList1.DataSource = Class1.ExecSel(sql).DefaultView;
            DropDownList1.DataTextField = "a1"; //dropdownlist的Text的字段
            DropDownList1.DataValueField = "id";//dropdownlist的Value的字段
            DropDownList1.DataBind();


            sql = "select a2,a1+'-'+a2 as a from tb_Room ";
            DropDownList2.DataSource = Class1.ExecSel(sql).DefaultView;
            DropDownList2.DataTextField = "a"; //dropdownlist的Text的字段
            DropDownList2.DataValueField = "a2";//dropdownlist的Value的字段
            DropDownList2.DataBind();
        }
    }






    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {


            string sqlstr = "insert into tb_CustRoom(a1,a2,a3,a4,a5)values('" + DropDownList1.SelectedItem.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + DropDownList2.SelectedValue + "','" + TextBox3.Text + "')";
            sqloperate.DataCom(sqlstr);
            Response.Write("<script language=javascript>alert('购房信息添加成功!');document.location='3uTeacherAdd.aspx'</script>");

        }
        catch
        {
            Response.Write("<script>alert('对不起,你的信息添加失败!');history.go(-1);</script>");
        }
后面还有 18 行代码,购买后查看完整代码

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

AI 解读 AI

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

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