downtypeadd.asp

来自「ASP编写的一个公司网站的源程序」· ASP 代码 · 共 113 行

ASP
113
字号
<%@ Language=VBScript %>
<%

Response.Buffer = True
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"

%>
<!--#include virtual="/Include/DBConn.asp"-->
<!--#include virtual="/Include/ChkSession.asp"-->
<!--#include virtual="/Include/FuncPub.asp"-->
<!--#include file="Function.asp"-->
<html>
<head>
<title>EditUsers</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content=" ">
<meta name="keywords" content=" ">

<link rel="stylesheet" href="../Css/css.css" type="text/css">

<script language="javascript">
	function formCheck() {
	  if (document.frmUsers.Type_Name.value=="") {
	    alert("请输入名称");
	    document.frmUsers.Type_Name.focus();
	    return false;
	  }

	   return true;
	   }
</script>	


</head>
<!--#include file="Menu.asp"-->
<!------------------------->
<!--修改Users<-->
<!--注意事项<-->

<!-- 以下内容由程序自动生成 -->
<%

IF Request.Form<>"" then
	Dim rs,StrSQL
	Dim Type_Name,State,Parent_ID,Type_ID,layer
	Type_Name = ModifyInput(trim(Request.Form("Type_Name")))
    Parent_ID = ModifyInput(trim(Request.Form("Parent_ID")))
	'On Error Resume Next
    Set rs = Server.CreateObject("Adodb.Recordset")
        CheckInput
    rs.CursorLocation=3
    StrSQL = "Select * From DownType Where Type_ID=0" 
    rs.Open StrSQL,conn,1,3 
    rs.AddNew 
		rs("Type_Name") = Type_Name
		rs("State") = State
		rs("Parent_ID") = Parent_ID
    rs.Update
		Type_ID = rs("Type_ID")
    rs.Close
    Conn.Execute "Update DownType Set Orderline="&Type_ID&" where Type_ID="&Type_ID&""
    If Err.number<>0 then
		Call MsgBack("数据库操作错误!","4")
    Else
		Response.Redirect "DownTypeManage.asp"
    End IF 
    Set rs = Nothing
    
    
    Sub CheckInput
	StrSQL="select count(*) as cou from DownType where parent_id="&Parent_ID&" and Type_Name='"&Type_Name&"'"
	Rs.open StrSQL,conn,1,3 
	If Rs("cou")<>0 then
		Rs.close 
		Call MsgBack("类别名重复!","4")
		exit Sub
	End If
	Rs.Close
	End Sub
 End IF
 
%>
<form name="frmUsers" method="POST" action="DownTypeAdd.asp"  ID="Form1" onsubmit="return formCheck()">
	<input type="hidden" name="Parent_ID" value="<%=Request("Parent_ID")%>" ID="Hidden1">
	<table border=0 cellspacing=1 cellpadding=2  class=list width=98% ID="Table1">
	<tr class=header><td colspan=2>添加下载类别</td></tr>

	<tr>
		<td  class=list>名称:</td>
		<td  class=list><input type="text" name="Type_Name" maxlength=50 size="30"  ID="Text3"><font color=red>*</font></td>
	</tr>
		<tr>
		<td  class=list>是否开放:</td>
		<td  class=list>是
        <input value=1 name=state type=radio  ID="Radio2" checked>
        &nbsp;&nbsp;&nbsp; 否 
        <input id="Radio7" value=0 name=state type=radio></td>
	</tr>
	</table>
	<p><input type="submit" value="提交" name="btnSubmit" ID=Submit> <input type="reset" value="重写" name="B2" ID=Reset1>
<input type=button name=back value="返回" onclick="window.history.go(-1);" ID="Button1">  	
	</p> 
</form>
<!------------------------->

</body>
</html>
<!--#include virtual="/Include/DBClose.asp"-->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?