📄 shop.aspx.cs
字号:
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 shop : System.Web.UI.Page
{
static string city;
static string transaction;
static string propertytype;
static string area;
static string price;
static string locality;
static string address;
static int propid;
static string userid;
protected void Page_Load(object sender, EventArgs e)
{
transaction = Session["t"].ToString();
city = Session["c"].ToString();
area = Session["area"].ToString();
price = Session["price"].ToString();
locality = Session["locality"].ToString();
address = Session["address"].ToString();
propertytype = Session["a"].ToString(); ;
propid = Convert.ToInt32(Session["prop"]);
userid=Session["uid"].ToString();
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox4_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox5_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox6_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox7_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox8_TextChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("insert into commercialshop(propertyid,noofbathrooms,ownership,security,furnishing,construction,floorno,facing,shortdescription,visitorparking,annualdues,internetfacility,backuppower,nooflifts,photourl) values ('"+propid+"','" + DropDownList7.SelectedItem.ToString() + "','" + DropDownList2.SelectedItem.ToString() + "','" + DropDownList3.SelectedItem.ToString() + "','" + DropDownList5.SelectedItem.ToString() + "','" + DropDownList6.SelectedItem.ToString() + "','" + DropDownList11.SelectedItem.ToString() + "','" + DropDownList4.SelectedItem.ToString() + "','" + TextBox8.Text + "','" + DropDownList14.SelectedItem.ToString() + "','" + DropDownList10.SelectedItem.ToString() + "','" + DropDownList9.SelectedValue.ToString() + "','" + DropDownList12.SelectedValue.ToString() + "','" + DropDownList17.SelectedValue.ToString() + "','" + FileUpload1.FileName + "')", conn);
DataSet ds = new DataSet();
da.Fill(ds);
SqlDataAdapter da1 = new SqlDataAdapter("insert into propertyforsalerent values('" + propid + "','" + transaction + "','" + propertytype + "','" + area + "','" + city + "','" + price + "','" + locality + "','" + address + "')", conn);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
SqlDataAdapter da2 = new SqlDataAdapter("insert into propertyowner (userid,propertyid) values ('" + userid + "','" + propid + "')", conn);
DataSet ds2 = new DataSet();
da2.Fill(ds2);
conn.Close();
Response.Redirect("thank.aspx");
}
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void DropDownList17_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void DropDownList10_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -