-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpropD.cs
65 lines (52 loc) · 1.83 KB
/
propD.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace realestate
{
public partial class propD : Form
{
public int id;
public propD(int id)
{
this.id = id;
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void propD_Load(object sender, EventArgs e)
{
string query = "Data Source =.; Initial Catalog = realestate; Integrated Security = TrueData Source =.; Initial Catalog = realestate; Integrated Security = True";
SqlConnection con = new SqlConnection(query);
con.Open();
string query1 = "select p.pr_id, p.address, pp.name, phone, featureName, email from property p join person pp on (pp.p_ID = p.owner_ID) join hasfeatures hf on (hf.pr_id = p.pr_id) join Features f on hf.code = f.code where p.pr_id ='" + id + "'";
SqlCommand cmd = new SqlCommand(query1, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
label1.Text = dr.GetValue(2).ToString();
label3.Text = dr.GetValue(1).ToString();
label4.Text = dr.GetValue(3).ToString();
label2.Text = dr.GetValue(4).ToString();
label5.Text = dr.GetValue(5).ToString();
}
con.Close();
}
private void label3_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Form1 ff = new Form1();
ff.Show();
this.Hide();
}
}
}