-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyacount.aspx.vb
83 lines (73 loc) · 3.88 KB
/
myacount.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
Imports System.Configuration
Imports System.Data.OleDb
Imports System.Web.HttpApplicationState
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.txtcmname.Text = Session("usr_name")
''WHERE eml_no=" & Session("user_name") & "
Me.Label1.Text = Session("hello")
Dim cona As New OleDbConnection
cona.ConnectionString = ConfigurationManager.AppSettings("con")
cona.Open()
Dim sql As String = "select * from company where cmp_no=" & Session("usr_name") & ""
Dim dp As New OleDbDataAdapter
Dim ds As New Data.DataSet
dp = New OleDbDataAdapter(sql, cona)
dp.Fill(ds, "company")
Dim i As Integer
For i = 0 To ds.Tables("company").Rows.Count - 1
Me.txtcmname.Text = ds.Tables("company").Rows(i).Item(1)
Next
End Sub
Protected Sub Menu14_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu14.MenuItemClick
Response.Redirect("default.aspx")
Session("usr_name") = 0
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cona As New OleDbConnection
cona.ConnectionString = ConfigurationManager.AppSettings("con")
cona.Open()
Dim sql As String = "select * from company"
Dim dp As New OleDbDataAdapter
Dim ds As New Data.DataSet
dp = New OleDbDataAdapter(sql, cona)
dp.Fill(ds, "company")
Dim savrr As New OleDbCommand
savrr.Connection = cona
' íÊã ÇÓÊÎÏÇã ÌãáÉ ÇáÇÓ ßíæ Çá ÇáÎÇÕÉ ÈÇáÊÚÏíá
savrr.CommandText = "UPDATE company SET cmp_name='" & Me.txtcmname.Text & "',cmp_cntry='" & Me.drpcntry.Text & "',cmp_city='" & Me.drpcity.Text & "',cmp_strt='" & Me.drpstreet.Text & "',cmp_tel='" & Me.txttel.Text & "',cmp_mob='" & Me.txtmobile.Text & "',cmp_mail='" & Me.txtemail.Text & "',cmp_other='" & Me.txtother.Text & "' where cmp_no=" & Session("usr_name") & ""
'åäÇ íÊã ÊäÝíÐ ÇáÌãáÉ
savrr.ExecuteNonQuery()
'MsgBox("Êã ÇáÊÚÏíá ÈäÌÇÍ", MsgBoxStyle.Information)
cona.Close()
End Sub
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
End Sub
Protected Sub drpstreet_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpstreet.TextChanged
End Sub
Protected Sub Menu2_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu2.MenuItemClick
Me.txtcmname.Text = Session("usr_name")
''WHERE eml_no=" & Session("user_name") & "
Dim cona As New OleDbConnection
cona.ConnectionString = ConfigurationManager.AppSettings("con")
cona.Open()
Dim sql As String = "select * from company where cmp_name='" & Me.Label1.Text & "'"
Dim dp As New OleDbDataAdapter
Dim ds As New Data.DataSet
dp = New OleDbDataAdapter(sql, cona)
dp.Fill(ds, "company")
Dim i As Integer
For i = 0 To ds.Tables("company").Rows.Count - 1
Me.txtcmname.Text = ds.Tables("company").Rows(i).Item(1)
Me.TextBox3.Text = ds.Tables("company").Rows(i).Item(0)
Me.drpcntry.Text = ds.Tables("company").Rows(i).Item(2)
Me.drpcity.Text = ds.Tables("company").Rows(i).Item(3)
Me.drpstreet.Text = ds.Tables("company").Rows(i).Item(4)
Me.txttel.Text = ds.Tables("company").Rows(i).Item(5)
Me.txtmobile.Text = ds.Tables("company").Rows(i).Item(6)
Me.txtemail.Text = ds.Tables("company").Rows(i).Item(7)
Me.txtother.Text = ds.Tables("company").Rows(i).Item(8)
Next
End Sub
End Class