Admin/AddRuZhu.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 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_AddRuZhu : System.Web.UI.Page
{

    SqlHelper data = new SqlHelper();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            DropDownList1.DataSource = data.GetDataReader("select * from  FloorInfo");
            DropDownList1.DataTextField = "Name";
            DropDownList1.DataValueField = "id";
            DropDownList1.DataBind();
            DropDownList1.Items.Add("请选择公寓楼");
            DropDownList1.Items[this.DropDownList1.Items.Count - 1].Value = " ";
            DropDownList1.SelectedIndex = this.DropDownList1.Items.Count - 1;
        }
    }
    protected void btn_Submit_Click(object sender, EventArgs e)
    {
        if (TextBox8.Text == "0")
        {
            Alert.AlertAndRedirect("没有空位请选择其他公寓", "AddRuZhu.aspx");
        }
        else
        {

            data.RunSql("insert into  OldPRuZhu(LouHaoId,LouHao,SuSheId,SuShe,LouCeng,StName,StNum,Stxi,Stds,Ds,StSex,FeiYong,ZongFeiYong,ShiJian)values('" + DropDownList1.SelectedValue + "','" + DropDownList1.SelectedItem.Text + "','" + DropDownList2.SelectedValue + "','" + DropDownList2.SelectedItem.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + this.TextBox6.Text + "','" + TextBox12.Text + "','" + TextBox11.Text + "','" + Label2.Text + "','" + TextBox13.Text+ "')");

            data.RunSql("insert into  OldPeople(UserNubmer,AddRessName,UserTrueName,UserDs,Sex)values('" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox2.Text + "','" + TextBox5.Text + "','" + TextBox12.Text + "')");


            data.RunSql("update HostelInfo set Kong=Kong-1,InNum=InNum+1 where id=" + DropDownList2.SelectedValue);
            Alert.AlertAndRedirect("办理成功", "AddRuZhu.aspx");
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList2.DataSource = data.GetDataReader("select * from  HostelInfo where Bid='" + DropDownList1.SelectedValue + "'");
        DropDownList2.DataTextField = "Num";
        DropDownList2.DataValueField = "id";
        DropDownList2.DataBind();
        DropDownList2.Items.Add("请选择公寓");
        DropDownList2.Items[this.DropDownList2.Items.Count - 1].Value = " ";
        DropDownList2.SelectedIndex = this.DropDownList2.Items.Count - 1;
    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlDataReader dr = data.GetDataReader("select * from HostelInfo where id=" + DropDownList2.SelectedValue);
后面还有 31 行代码,购买后查看完整代码

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

AI 解读 AI

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

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