⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appartment.aspx.cs

📁 its a website on property dealing made in c# and .net framework.. the database is missing though.
💻 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 appartment : 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 residentialapartment (propertyid,noofbedrooms,noofbathrooms,ownership,security,furnishing,construction,floorno,facing,shortdescription,privateterrace,watertanks,reservedparking,annualdues,internetfacility,backuppower,servantquarter,swimmingpool,liftfacility,railwaydistance,schooldistance,busstopdistance,hospitaldistance,photourl) values ('" + propid + "','" + DropDownList1.SelectedItem.ToString() + "','" + DropDownList7.SelectedItem.ToString() + "','" + DropDownList2.SelectedItem.ToString() + "','" + DropDownList3.SelectedItem.ToString() + "','" + DropDownList5.SelectedItem.ToString() + "','" + DropDownList6.SelectedItem.ToString() + "','" + DropDownList11.SelectedItem.ToString() + "','" + DropDownList4.SelectedItem.ToString() + "','" + TextBox8.Text + "','" + DropDownList12.SelectedItem.ToString() + "','" + DropDownList8.SelectedValue.ToString() + "','" + DropDownList13.SelectedItem.ToString() + "','" + DropDownList10.SelectedItem.ToString() + "','" + DropDownList9.SelectedItem.ToString() + "','" + DropDownList14.SelectedItem.ToString() + "','" + DropDownList15.SelectedItem.ToString() + "','" + DropDownList16.SelectedItem.ToString() + "','" + DropDownList17.SelectedItem.ToString() + "','" + TextBox5.Text + "','" + TextBox7.Text + "','" + TextBox4.Text + "','" + TextBox6.Text + "','" + 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 DropDownList17_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList16_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList14_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList12_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void TextBox3_TextChanged(object sender, EventArgs e)
    {

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -