Admin/AddLFInfo.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 Admin_AddLFInfo : 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)
{
data.RunSql("insert into LFInfo(LouHaoId,LouHao,SuSheId,SuShe,LouCeng,StName,StNum,LFName,Ds)values('" + DropDownList1.SelectedValue + "','" + DropDownList1.SelectedItem.Text + "','" + DropDownList2.SelectedValue + "','" + DropDownList2.SelectedItem.Text + "','" + TextBox1.Text + "','" + TextBox11.Text + "','" + this.TextBox2.Text + "','" + this.TextBox3.Text + "','" + TextBox6.Text + "')");
Alert.AlertAndRedirect("添加成功", "AddLFInfo.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);
dr.Read();
TextBox7.Text = dr["RenShu"].ToString();
TextBox8.Text = dr["Kong"].ToString();
TextBox9.Text = dr["InNum"].ToString();
TextBox1.Text = dr["Floor"].ToString();
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
SqlDataReader dr = data.GetDataReader("select * from OldPeople where UserNubmer='" + TextBox2.Text + "'");
if (dr.Read())
{
后面还有 9 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。