-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchdesk.aspx.vb
260 lines (206 loc) · 11.6 KB
/
searchdesk.aspx.vb
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
Imports System.Configuration
Imports System.Data.OleDb
Imports System.Web.HttpApplication
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
Imports ASP.searchdesk_aspx
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim i As Integer
' Dim con As New OleDbConnection
' ' con.ConnectionString = ConfigurationManager.AppSettings("con")
' con.Open()
' Dim ds As New Data.DataSet
' Dim dp As New OleDbDataAdapter("SELECT q FROM n ", con)
' dp.Fill(ds, "n")
' Dim s As New OleDbCommand
' s.Connection = con
's.CommandType = Data.CommandType.Text
' s.CommandText = "insert into n (w,q) values (" & Me.TextBox2.Text & ",'" & Me.TextBox1.Text & "')"
'con.Open()
' s.ExecuteNonQuery()
' con.Close()
' Response.Redirect("Default.aspx")
' For i = 0 To ds.Tables("n").Rows.Count = 0
' 'Response.Write(Me.TextBox1.Text = ds.Tables("n").Rows(i).Item(0))
' 'Response.Write(Me.TextBox2.Text = ds.Tables("n").Rows(i).Item(1))
' drpcartype.Items.Add(ds.Tables("n").Rows(i).Item(0))
' Next
'End If
End Sub
'Protected Sub drpcartype_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpcartype.SelectedIndexChanged
' 'Me.drpcartype.Items.Clear()
' ' Dim i As Integer
' ' Dim con As New OleDbConnection
' 'con.ConnectionString = ConfigurationManager.AppSettings("con")
' 'con.Open()
' 'Dim ds As New Data.DataSet
' 'Dim dp As New OleDbDataAdapter("SELECT * FROM n where w =" & Me.drpcartype.Text & " ", con)
' 'dp.Fill(ds, "n")
' 'Me.GridView1.DataSource = ds
' 'Me.GridView1.DataMember = "n"
'End Sub
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'1.0.1
Session("qw") = Me.drpcntry.SelectedValue
If Me.drpcntry.Items.Count < 2 Then
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
ds.Clear()
Dim dp As New OleDbDataAdapter("SELECT distinct cmp_cntry FROM company ", con)
dp.Fill(ds, "company")
Dim clr As Integer = ds.Tables("company").Rows.Count
'
For i = 0 To clr - 1
Me.drpcntry.Items.Add(ds.Tables("company").Rows(i).Item(0))
Next
End If
End Sub
Protected Sub Menu3_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu3.MenuItemClick
End Sub
Protected Sub drpcmp_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpcmp.SelectedIndexChanged
'1.1.3
Me.drptypecm.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Dim dp As New OleDbDataAdapter("SELECT desktob.dsk_type, desktob.cmp_no, company.cmp_name FROM company INNER JOIN desktob ON company.cmp_no = desktob.cmp_no WHERE (((company.cmp_name)='" & Me.drpcmp.SelectedValue & "')) ", con)
dp.Fill(ds, "deskto")
For i = 0 To ds.Tables("deskto").Rows.Count - 1
'Me.lb2.Text = ds.Tables("deskto").Rows(i).Item(0)
If Not IsDBNull(ds.Tables("deskto").Rows(0).Item(0)) Then Me.drptypecm.Items.Add(ds.Tables("deskto").Rows(i).Item(0))
Next
'Me.drptypecm.Enabled = True
con.Close()
Me.Button6.Enabled = True
End Sub
Protected Sub droptype_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drptypecm.SelectedIndexChanged
'SELECT desktob.dsk_modul, desktob.cmp_no, company.cmp_name FROM company INNER JOIN desktob ON company.cmp_no = desktob.cmp_no WHERE (((desktob.dsk_modul)="toshiba") AND ((company.cmp_name)="ØáÇá"));
Me.dropmodel.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Me.dropmodel.Items.Add("ÇÎÊÑ ãä ÇáÞÇÆãÉ")
Dim dp As New OleDbDataAdapter("SELECT desktob.dsk_modul, desktob.dsk_type, desktob.cmp_no, company.cmp_name FROM company INNER JOIN desktob ON company.cmp_no = desktob.cmp_no WHERE ((desktob.dsk_type)='" & Me.drptypecm.SelectedValue & "') AND ((company.cmp_name)='" & Me.drpcmp.SelectedValue & "')", con)
dp.Fill(ds, "deskt")
For i = 0 To ds.Tables("deskt").Rows.Count - 1
' Me.lb3.Text = ds.Tables("deskt").Rows(i).Item(0)
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item(0)) Then Me.dropmodel.Items.Add(ds.Tables("deskt").Rows(i).Item(0))
Next
End Sub
Protected Sub Button6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.dropmodel.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Dim dp As New OleDbDataAdapter("SELECT desktob.dsk_modul, desktob.dsk_type, desktob.cmp_no, company.cmp_name FROM company INNER JOIN desktob ON company.cmp_no = desktob.cmp_no WHERE ((desktob.dsk_type)='" & Me.drptypecm.SelectedValue & "') AND ((company.cmp_name)='" & Me.drpcmp.SelectedValue & "')", con)
dp.Fill(ds, "deskt")
For i = 0 To ds.Tables("deskt").Rows.Count - 1
' Me.lb3.Text = ds.Tables("deskt").Rows(i).Item(0)
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item(0)) Then Me.dropmodel.Items.Add(ds.Tables("deskt").Rows(i).Item(0))
Next
'Me.drptypecm.Enabled = True
con.Close()
Me.Button4.Visible = True
Me.Button6.Enabled = False
End Sub
Protected Sub drpcntry_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpcntry.SelectedIndexChanged
'1.1.1
Me.drptypecm.Items.Clear()
Me.drpcity.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Me.drpcity.Items.Add("")
Dim dp As New OleDbDataAdapter("SELECT company.* FROM company WHERE (((company.cmp_cntry)='" & Me.drpcntry.SelectedValue & "')) ", con)
dp.Fill(ds, "deskto")
For i = 0 To ds.Tables("deskto").Rows.Count - 1
'Me.lb2.Text = ds.Tables("deskto").Rows(i).Item(0)
If Not IsDBNull(ds.Tables("deskto").Rows(i).Item(0)) Then Me.drpcity.Items.Add(ds.Tables("deskto").Rows(i).Item(3))
Next
'Me.drptypecm.Enabled = True
con.Close()
End Sub
Protected Sub drpcity_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpcity.SelectedIndexChanged
'1.1.2
Me.drptypecm.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Me.drptypecm.Items.Add("")
Dim dp As New OleDbDataAdapter("SELECT company.cmp_name FROM company WHERE (((company.cmp_city)='" & Me.drpcity.SelectedValue & "')) ", con)
dp.Fill(ds, "deskto")
For i = 0 To ds.Tables("deskto").Rows.Count - 1
'Me.lb2.Text = ds.Tables("deskto").Rows(i).Item(0)
If Not IsDBNull(ds.Tables("deskto").Rows(i).Item(0)) Then Me.drpcmp.Items.Add(ds.Tables("deskto").Rows(i).Item(0))
Next
'Me.drptypecm.Enabled = True
con.Close()
End Sub
Protected Sub sendcomp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles sendcomp.Click
Session("sub") = (Me.lb3.Text + (":") + Me.lb4.Text + (" ") + Me.lb7.Text + (":") + Me.lb8.Text + Me.lb5.Text + Me.lb6.Text + Me.Label9.Text + Me.lb10.Text + Me.Label11.Text + Me.lb12.Text + Me.Label1.Text + Me.lb14.Text)
Me.drptypecm.Items.Clear()
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Dim dp As New OleDbDataAdapter("SELECT company.cmp_mail, company.cmp_name, company.cmp_no FROM company INNER JOIN email ON company.cmp_no = email.cmp_no WHERE cmp_name='" & Me.drpcmp.SelectedValue & "'", con)
dp.Fill(ds, "deskto")
For i = 0 To ds.Tables("deskto").Rows.Count - 1
'Me.lb2.Text = ds.Tables("deskto").Rows(i).Item(0)
'Session("b") = ds.Tables("deskto").Rows(i).Item("cmp_mail")
Session("no") = ds.Tables("deskto").Rows(i).Item(2)
Next
Response.Redirect("send.aspx")
'Me.drptypecm.Enabled = True
con.Close()
End Sub
Protected Sub dropmodel_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles dropmodel.SelectedIndexChanged
Me.lb10.Visible = True
Me.lb3.Visible = True
Me.lb4.Visible = True
Me.lb5.Visible = True
Me.lb6.Visible = True
Me.lb7.Visible = True
Me.lb8.Visible = True
Me.lb12.Visible = True
Me.lb14.Visible = True
Me.Label1.Visible = True
Me.Label11.Visible = True
Me.Label9.Visible = True
Dim i As Integer
Dim con As New OleDbConnection
con.ConnectionString = ConfigurationManager.AppSettings("con")
con.Open()
Dim ds As New Data.DataSet
Dim d As New OleDbDataAdapter("SELECT desktob.dsk_modul, desktob.dsk_type, desktob.dsk_hdd, desktob.dsk_ram, desktob.dsk_cpu, desktob.dsk_lcd, desktob.dsk_cost, desktob.dsk_other, desktob.cmp_no, company.cmp_name FROM company INNER JOIN desktob ON company.cmp_no = desktob.cmp_no WHERE ((desktob.dsk_modul)='" & Me.dropmodel.SelectedValue & "') AND ((desktob.dsk_type)='" & Me.drptypecm.SelectedValue & "') AND ((company.cmp_name)='" & Me.drpcmp.SelectedValue & "')", con)
d.Fill(ds, "deskt")
For i = 0 To ds.Tables("deskt").Rows.Count - 1
' Me.lb2.Text = ds.Tables("deskt").Rows(i).Item("dsk_modul")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_hdd")) Then Me.lb4.Text = ds.Tables("deskt").Rows(i).Item("dsk_hdd")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_ram")) Then Me.lb6.Text = ds.Tables("deskt").Rows(i).Item("dsk_ram")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_cpu")) Then Me.lb8.Text = ds.Tables("deskt").Rows(i).Item("dsk_cpu")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_lcd")) Then Me.lb10.Text = ds.Tables("deskt").Rows(i).Item("dsk_lcd")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_other")) Then Me.lb12.Text = ds.Tables("deskt").Rows(i).Item("dsk_other")
If Not IsDBNull(ds.Tables("deskt").Rows(i).Item("dsk_cost")) Then Me.lb14.Text = ds.Tables("deskt").Rows(i).Item("dsk_cost")
Next
con.Close()
End Sub
End Class