⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modifycomponent.asp

📁 不错的代码 看完后一定要留评论哦 有疑问联系我
💻 ASP
字号:
<!-- #INCLUDE FILE="odbc_connection.inc" -->
<%
strProductID=request.querystring("PID")
strSystemDescription=request.querystring("DES")
ComponentID=request.querystring("CID")
intKey=request.querystring("KEY")
intSessionID=session.sessionID
CategoryID=request.form("cboCategory")
ADD=request.querystring("ADD")

if ADD="y" then
	CategoryID=1
else
	if (CategoryID=0 or len(CategoryID)=0 or CategoryID="") then
		'find categoryID of this component:
		sSQL="SELECT CategoryID FROM tblInventory WHERE strProductID='" & ComponentID & "'"
		Set RS = Server.CreateObject("ADODB.Recordset")
		RS.Open sSQL, conn, 3, 3 'read
		CategoryID=RS("CategoryID")
		RS.close
		set RS=nothing
	end if
end if
%>

<html>
<head></head>
<body>
<table BORDER="0" WIDTH="100%">
<tr bgcolor="#F2F2FF">
<td ALIGN="CENTER">
<center><font size="3"><b>Modify <%=strSystemDescription%></b></font></center>

<table border="0" width="85%" cellspacing="7" cellpadding="4">

<tr BGCOLOR="AZURE"><td align="right"><b>Component Type</td>
<td align="left">
<form name="Category" METHOD="POST" action="modifyComponent.asp?PID=<%=strProductID%>&amp;CID=<%=ComponentID%>&amp;KEY=<%=intKey%>&amp;DES=<%=strSystemDescription%>">
<%
sSQL="SELECT "
sSQL=sSQL & "CategoryID, "
sSQL=sSQL & "strWebCategory "
sSQL=sSQL & "FROM tblCategoryWeb "
sSQL=sSQL & "ORDER BY strWebCategory"
Set rsCategories = Server.CreateObject("ADODB.Recordset")
rsCategories.open sSQL, conn, 3, 3 'read
response.write "<Select Size='1' NAME='cboCategory'>"

do while not (rsCategories.EOF)
	if CInt(rsCategories("CategoryID"))=CInt(CategoryID) then
		selected=" selected"
	else
		selected=""
	end if

	response.write "<option value='" & rsCategories("CategoryID") & "'" & selected & "> " & rsCategories("strWebCategory") & " </option>"
	rsCategories.movenext
loop
rsCategories.close
set rsCategories=nothing
response.write "</Select>"
%>
</b></td><td align="right"><input type="submit" value="Change"></td></tr></form>
<form name="Part" METHOD="POST" action="modifyComponentDo.asp?PID=<%=strProductID%>&amp;CID=<%=ComponentID%>&amp;KEY=<%=intKey%>&amp;DES=<%=strSystemDescription%>">
<!-- next row -->
<tr BGCOLOR="AZURE"><td align="right"><b>Change To</td><td align="left">
<%
sSQL="SELECT "
sSQL=sSQL & "strProductID, "
sSQL=sSQL & "txtDescription "
sSQL=sSQL & "FROM tblInventory "
sSQL=sSQL & "WHERE CategoryID=" & CategoryID & " "
sSQL=sSQL & "ORDER BY txtDescription"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.open sSQL, conn, 3, 3 'read
response.write "<Select Size='1' NAME='cboProduct'>"

do while not (RS.EOF)
	if RS("strProductID")=ComponentID then
		selected=" selected"
	else
		selected=""
	end if
	DES=RS("txtDescription")
	DLN=len(DES)
	if DLN>40 then DES=left(DES,40)
	response.write "<option value='" & RS("strProductID") & "'" & selected & "> " & DES & " </option>"
	RS.movenext
loop
RS.close
set RS=nothing

response.write "<option value='delete'>REMOVE THIS PART FROM MY SYSTEM</option>"
response.write "</Select>"
%></b></td>
<td align="right"><input type="submit" value="Change"></td>
</tr>
</table>
</form>
</td></tr>
</table>

<table border="0" width="100%">
	<tr bgcolor="#E3E3FF">
	<td valign="center" align="center">
	<a href="ProductDescriptionSys.asp?CategoryID=<%=CategoryID%>&amp;strProductID=<%=strProductID%>">
	<img src="graphics/Back.gif" alt="Back To Inventory Screen" border="0"></a>
	</td>
	</tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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