📄 addsupplier.asp
字号:
<!-- #include file="admin_protect.inc" -->
<!-- #include file="../opendb.inc" -->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta Name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta Name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; chaRset=gb2312">
<title>添加供应商页面</title>
</head>
<body>
<script language="JavaScript">
</script>
<p align="center"><font color="#0000FF"><b>添加新供应商</b></font></p>
<form method="POST" Name="addsupplier" action="addsupplier.asp">
<div align="center">
<center>
<table border="1" cellspacing="1" width="50%" id="AutoNumber1" height="275">
<tr bgcolor="#CCCCCC">
<td width="50%">供应商帐号</td>
<td width="50%">
<input type="text" Name="companyName" size="20"></td>
</tr>
<tr>
<td width="50%">地 址</td>
<td width="50%"><input type="text" Name="Address" size="20"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="50%">所在城市</td>
<td width="50%">
<input type="text" Name="City" size="20"></td>
</tr>
<tr>
<td width="50%">邮政编码</td>
<td width="50%"><input type="text" Name="PostalCode" size="20"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="50%">所在国家</td>
<td width="50%">
<input type="text" Name="Country" size="20"></td>
</tr>
<tr>
<td width="50%">联系电话</td>
<td width="50%"><input type="text" Name="telephone" size="20"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="50%">所在区域</td>
<td width="50%">
<input type="text" Name="region" size="20"></td>
</tr>
<tr>
<td width="50%">FAX</td>
<td width="50%"><input type="text" Name="Fax" size="20"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="50%">Email</td>
<td width="50%">
<input type="text" Name="Email" size="20"></td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" value="添加供应商" Name="Submit">
<input type="reset" value="重新填写" Name="B2"><input type="hidden" Name="action" value="addsupplier"></p>
</form>
<p align="center"> </p>
</body>
</html>
<%
If Request("Action")<>"addsupplier" Then
Response.End
Else
If Request("Action")="addsupplier" Then
CompanyName=Request("CompanyName")
If CompanyName ="" Then
'response.Redirect "Error.Asp?Error=001"
Response.Write"<Script Language=Javascript>alert('供应商不能为空!');"
Response.Write"Javascript:history.Go(-1)</Script>"
Response.End
End If
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open(sqlOpenDB) '打开数据库
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open "Select * From Supplier Where CompanyName='"&CompanyName&"'",Conn
If Not Rs.Eof Then
Response.Redirect "Error.Asp?Error=003"
Response.End
End If
Set Rs=Nothing
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open"Supplier",Conn,1,3
Conn.Execute "Insert Into Supplier (CompanyName) Values ('"&CompanyName&"')"
Response.Redirect "Success.Asp?Success=009"
End If
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -