001.
<%@ Import Namespace=
"System.Data"
%>
002.
<%@ Import Namespace=
"System.Data.SqlClient"
%>
003.
<%@ Page Language=
"C#"
Debug=
"true"
EnableEventValidation=
"true"
%>
004.
<script runat=
"server"
>
005.
006.
SqlConnection objConn;
007.
SqlCommand objCmd;
008.
String strSQL;
009.
010.
public
void
Page_Load(
object
sender, EventArgs e)
011.
{
012.
013.
String strConnString;
014.
strConnString =
"Server=localhost;UID=sa;PASSWORD=;database=cartoon;Max Pool Size=400;Connect Timeout=6000;"
;
015.
objConn =
new
SqlConnection(strConnString);
016.
objConn.Open();
017.
if
(!Page.IsPostBack)
018.
{
019.
BindData();
020.
}
021.
022.
}
023.
024.
void
BindData()
025.
{
026.
String strSQL;
027.
strSQL =
"select top (1)CusID from Customer order by CusID desc"
;
028.
029.
SqlDataReader dtReader;
030.
objCmd =
new
SqlCommand(strSQL, objConn);
031.
dtReader = objCmd.ExecuteReader();
032.
033.
034.
dtReader.Close();
035.
dtReader =
null
;
036.
}
037.
038.
039.
040.
protected
void
Button2_Click(
object
sender, EventArgs e)
041.
{
042.
043.
TextBox txtTextBox1 =
this
.TextBox1.Text;
044.
045.
TextBox txtTextBox2 =
this
.TextBox2.Text;
046.
047.
TextBox txtTextBox3 =
this
.TextBox3.Text;
048.
049.
TextBox txtTextBox4 =
this
.TextBox4.Text;
050.
051.
TextBox txtTextBox5 =
this
.TextBox5.Text;
052.
053.
054.
strSQL =
"update Customer set Name='"
+ txtTextBox1.Text +
"',SurName='"
+ txtTextBox2.Text +
"',Address ='"
+ txtTextBox3.Text +
"',Email='"
+ txtTextBox4.Text +
"',Phone='"
+ txtTextBox5.Text +
"' where CusID = (select top(1)CusID from Customer order by CusID desc)"
;
055.
objCmd =
new
SqlCommand(strSQL, objConn);
056.
objCmd.ExecuteNonQuery();
057.
058.
}
059.
</script>
060.
061.
<html>
062.
<head id=
"Head1"
runat=
"server"
>
063.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
/>
064.
<title>Cartoon2ndHand</title>
065.
<style type=
"text/css"
>
066.
067.
body {
068.
background-image: url(images/bg.gif);
069.
background-repeat: repeat;
070.
}
071.
a {
072.
font-size: 10px;
073.
}
074.
.style9
075.
{
076.
height: 31px;
077.
}
078.
.style10
079.
{
080.
height: 26px;
081.
}
082.
-->
083.
</style></head>
084.
<body><form id=
"form1"
runat=
"server"
>
085.
086.
<table width=
"961"
height=
"1281"
border=
"0"
align=
"center"
>
087.
<tr>
088.
<td width=
"1024"
height=
"1277"
valign=
"top"
><table width=
"955"
height=
"1275"
border=
"0"
>
089.
<tr>
090.
<td width=
"949"
height=
"132"
><div align=
"center"
><img src=
"images/header edit.jpg"
width=
"934"
height=
"126"
/></div></td>
091.
</tr>
092.
<tr>
093.
<td
class
=
"style10"
><table height=
"35"
border=
"0"
align=
"center"
094.
style=
"width: 949px"
>
095.
<tr align=
"center"
>
096.
<td width=
"173"
class
=
"style9"
><a href=
"default.aspx"
><img src=
"images/Tab home.jpg"
width=
"150"
height=
"30"
border=
"0"
/></a></td>
097.
<td width=
"150"
class
=
"style9"
><a href=
"page1.aspx"
><img src=
"images/Tab product light.jpg"
width=
"150"
height=
"30"
border=
"0"
></a></td>
098.
<td width=
"150"
class
=
"style9"
><a href=
"page2.aspx"
><img src=
"images/Tab Buy the book..jpg"
width=
"150"
height=
"30"
border=
"0"
></a></td>
099.
<td width=
"150"
class
=
"style9"
><a href=
"page3.aspx"
><img src=
"images/Tab How to order.jpg"
width=
"150"
height=
"30"
border=
"0"
></a></td>
100.
<td width=
"150"
class
=
"style9"
><a href=
"page4.aspx"
><img src=
"images/Tab Contact us.jpg"
width=
"150"
height=
"30"
border=
"0"
></a></td>
101.
<td width=
"222"
class
=
"style9"
><asp:HyperLink id=
"hplLogout"
NavigateURL=
"Logout.aspx"
runat=
"server"
><img src=
"images/logout.jpg"
width=
"150"
height=
"30"
></asp:HyperLink></td>
102.
</tr>
103.
</table></td>
104.
</tr>
105.
<tr>
106.
<td height=
"1097"
valign=
"top"
><table width=
"949"
height=
"1095"
border=
"0"
>
107.
<tr>
108.
<td width=
"180"
height=
"1091"
valign=
"top"
><table width=
"180"
height=
"500"
border=
"1"
align=
"left"
cellpadding=
"0"
cellspacing=
"0"
>
109.
<tr>
110.
<td width=
"204"
>
111.
</td>
112.
</tr>
113.
<tr>
114.
<td> </td>
115.
</tr>
116.
<tr>
117.
<td> </td>
118.
</tr>
119.
<tr>
120.
<td> </td>
121.
</tr>
122.
<tr>
123.
<td> </td>
124.
</tr>
125.
<tr>
126.
<td> </td>
127.
</tr>
128.
<tr>
129.
<td> </td>
130.
</tr>
131.
132.
</table></td>
133.
<td width=
"759"
valign=
"top"
><p><img src=
"images/managepurchase.jpg"
width=
"700"
height=
"35"
><br />
134.
<br />
135.
136.
137.
138.
139.
<br />ª×èÍ
140.
<asp:TextBox ID=
"TextBox1"
runat=
"server"
></asp:TextBox>
141.
<asp:Label ID=
"Label1"
runat=
"server"
Text=
" "
></asp:Label>
142.
<br />
143.
<br />
144.
¹ÒÁÊ¡ØÅ <asp:TextBox ID=
" "
runat=
"server"
Width=
"192px"
></asp:TextBox>
145.
<asp:Label ID=
"Label2"
runat=
"server"
Text=
"Label"
></asp:Label>
146.
<br />
147.
<br />
148.
·ÕèÍÂÙè <asp:TextBox ID=
" "
runat=
"server"
Height=
"58px"
Width=
"319px"
></asp:TextBox>
149.
<asp:Label ID=
"Label3"
runat=
"server"
Text=
"Label"
></asp:Label>
150.
<br />
151.
<br />
152.
E-Mail <asp:TextBox ID=
" "
runat=
"server"
></asp:TextBox>
153.
<asp:Label ID=
"Label4"
runat=
"server"
Text=
"Label"
></asp:Label>
154.
<br />
155.
<br />
156.
àºÍÃìâ·ÃÈѾ·ì <asp:TextBox ID=
"TextBox5"
runat=
"server"
></asp:TextBox>
157.
<asp:Label ID=
"Label5"
runat=
"server"
Text=
" "
></asp:Label>
158.
</p>
159.
<p> </p>
160.
<p> <br />
161.
162.
163.
164.
<br />
165.
<asp:Button ID=
"Button2"
runat=
"server"
Text=
"Â×¹Âѹ¡ÒÃÊÑ觫×éÍ"
166.
PostBackUrl=
"~/page5-2-3.aspx"
onclick=
"Button2_Click"
/>
167.
</p>
168.
</td>
169.
</tr>
170.
</table></td>
171.
</tr>
172.
</table></td>
173.
</tr>
174.
</table>
175.
</form>
176.
</body>
177.
</html>