?? save.asp
字號:
<!--#include file='DBCn.asp'-->
<%
T_ClientID = request.form("T_ClientNameID")
T_ClientName = replace(request.form("T_ClientName"),"'","''")
T_ClientEmail =replace(request.form("T_ClientEmail"),"'","''")
T_ClientNation=replace(request.form("T_ClientNation"),"'","''")
T_ClientPro =replace(request.form("T_ClientPro"),"'","''")
T_ClientHpage =replace(request.form("T_ClientHpage"),"'","''")
T_ClientPcode =replace(request.form("T_ClientPcode"),"'","''")
T_ClientIncome=Clng(request.form("T_ClientIncome"))
T_ClientEmpNum=Clng(request.form("T_ClientEmpNum"))
T_ClientTel =replace(request.form("T_ClientTel"),"'","''")
T_ClientFax =replace(request.form("T_ClientFax"),"'","''")
T_ClientAdd =replace(request.form("T_ClientAdd"),"'","''")
T_ClientABank =replace(request.form("T_ClientABank"),"'","''")
T_ClientANum =replace(request.form("T_ClientANum"),"'","''")
%>
<%
if T_ClientID <> 0 then
sql= "update Customer set Name='"&T_ClientName&"',Nation='"&T_ClientNation&"',Province='"&T_ClientPro&"',PostCode='"&T_ClientPcode&"',Address='"&T_ClientAdd&"',Phone='"&T_ClientTel&"',Fax='"&T_ClientFax&"',Email='"&T_ClientEmail&"',Homepage='"&T_ClientHpage&"',YearIncome="&T_ClientIncome&",EmpNum="&T_ClientEmpNum&",AccountBank='"&T_ClientABank&"',AccountNum='"&T_ClientANum&"' where ID= '"&T_ClientID&"'"
'更新數據庫數據
else
sql="insert into Customer (Name,Nation,Province,PostCode,Address,Phone,Fax,Email,Homepage,YearIncome,EmpNum,AccountBank,AccountNum) values ('"&T_ClientName&"','"&T_ClientNation&"','"&T_ClientPro&"','"&T_ClientPcode&"','"&T_ClientAdd&"','"&T_ClientTel&"','"&T_ClientFax&"','"&T_ClientEmail&"','"&T_ClientHpage&"',"&T_ClientIncome&","&T_ClientEmpNum&",'"&T_ClientABank&"','"&T_ClientANum&"' )"
end if
'添加數據到數據庫
conn.execute( sql ) '執行數據庫更新
if T_ClientID = 0 then
set rs=conn.execute("select top 1 ID from Customer order by ID desc")
T_ClientID = rs("ID")
rs.close
end if
%>
<html>
<head>
<title>保存客戶信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<LINK
href="css.css" type=text/css rel=stylesheet>
</head>
<body>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width="100%" height="197" align="center">
<table border="0" cellspacing="0" cellpadding="0" height="85" bgcolor="#99ccff" width="100%">
<tr>
<td align="center">
<a href="customer.asp?clientid=<%=T_ClientID%>" class=linkblue2>保存客戶信息成功!!單擊返回</a>
<%
response.write "<script>"
response.write "setTimeout("&Chr(34)&"location.replace('Customer.asp?clientid="&T_ClientID&"')"&Chr(34)&",1000)"
response.write "</script>"
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -