- 打印本文 关闭窗口
- ASP与SQL网站数据库程序设计(16)
- 作者:.. 文章来源:科学出版社 点击数: 更新时间:2004/1/25 1:09:56
- ify.asp程序段
25: <% Function MainScreen %>
.
(HTML文件内容、CSS设置)
.
56: <Form Name="ChgClassify" Method="Post">
57: <table Border=1 border=0 cellpadding=1 cellspacing=1 bgcolor="tan">
58: <tr><td>
59: <select Name="Classify" OnChange="selChange(document. ChgClassify.Classify)">
60: <Option Value="0">请选择分类</option>
61: <% For i = 0 to ubound(Datas1,2) %>
62: <option value="<%=Datas1(0,I)%>">
63: <% = Datas1(0,i) %>--<% = Datas1(1,i) %></option>
64: <% Next %>
65: </select>
66: 分类选择之前,产品信息将无法出现!
67: <input type="Text" Name="AppointNo" Value="" Size= "12" Maxlength="10">
68: <input type="Submit" Name="Submit" Value="编号指定">
69: </td></tr>
70: </table>
71: <%
72: if trim(request.form("AppointNo")) = "" Then
73: for i = 0 to ubound(datas1,2)
74: if trim(datas1(0,i)) = trim(ClassifyNo) then
75: ProductsShow
76: exit for
77: end if
78: next
79: else
80: ProductsShow
81: end if
82: %>
83: </Form>
84:
85: <% end Function %>
程序说明
本段程序代码的作用与“产品下架”所用的“产品类别”内容展示的程序代码完全相同。因此,在此不多做说明。唯一不同点在于第67~68行,提供直接指定产品的“产品编号”,直接选取与指定代号相符的“产品基本信息”。
ProductModify.asp 程序段
87: <% function ProductsShow() %>
88:
89: <table Border=1 border=1 cellpadding=1 cellspacing=1 bgcolor='tan' class='ChiDingSt03'>
90:
91: <%
92: if trim(request.form("AppointNo")) = "" Then
93: SQL = "Select * from 产品基本信息 Where 类别编号=" & ClassifyNo & " Order by 类别编号,产品代号"
94: Else
95: SQL = "Select * from 产品基本信息 Where 产品代号='" & request.form("AppointNo") & "'"
96: End If
97: On Error Resume Next
98: Set Rs = OBJConn.Execute(SQL)
99:
100: if not rs.eof then
101: Datas = rs.getrows(maxrecords)
102: Session("Recordes") = ubound(datas,2)
103: else
104: Session("Recordes") = -1
105: end if
106:
107: if session("recordes") >= 0 then
108: response.write "<input type='hidden' Name= 'TotalRecords' Value='" & session("recordes") & "'>"
109: for j = 0 to Session("Recordes")
110: %>
111: <tr>
112: <td>修改<input type=hidden Name=Class ifyNo Value="<% = Request.QueryString("ClassifyNo")%>"></td>
113: <td width='80'>产品代号</td>
114: <td width='160'>产品名称</td>
115: <td width='240'>规格说明</td>
116: <td width='120'>产品缩图</td>
117: </tr>
118:
119: <tr>
120: <td align='center' rowspan='5'>
121: <input type=checkbox Name='Check<%= j %>'>
122: <input type=hidden Name='Products<%=j%>' Value='<% = datas(0,j)%>'>
123: </td>
124: <td Valign="Top">
125: <% = Datas(0,j) %>
126: </td>
127: <td Valign="Top">
128: <Input Type="Text" Name="ProductName<% = j %>" Value="<% = Datas(1,j) %>">
129: </td>
130: <td valign="Top">
131: <textarea Cols="40" Rows="5" Name="Speci ficationNo<% = j %>"><% = Datas(3,j) %></textarea>
132: </td>
133: <td><img src='/Images/<% = datas(0,j) %>_1.jpg' border='0'></td>
134: </tr>
135: <tr><td>币别</td><td>
136: <select Name='CurrencyType<%=j%>'>
137: <option Value=''>未设置币别</option>
138: <%
139: for K = 0 to ubound(Currencies,2)
140: if currencies(0,k) = datas(5,j) then
141: response.write "<option value='" & currencies(0,k) & "' selected>" & currencies(1,k)
142: else
143: response.write "<option value='" & currencies(0,k) & "'>" & currencies(1,k)
144: end if
145: next
146: %>
147: </select>
148: </td>
149: <td >备注</td>
150: </tr>
151: <tr><td>单价</td><td><input type=text Name= 'Price<%=j%>' value='<% = datas(4,j)%>' size='11'></td>
152: <td rowspan='3' Valign='top' align= 'left'>
153: <textarea cols='40' Rows='5' name='Memo <%=j%>'><% = datas(8,j)%></textarea></td>
154: </tr>
155: <tr><td>交货期</td><td><input type=text Name= 'Delivery<%=j%>' value='<% = datas(6,j)%>' Size='11'></td></tr>
156: <tr>
157: <td>新上市?</td><td>
158: <% if datas(7,j) = True then %>
159: <input type=checkbox name='New-Arrival<% = j %>' checked>
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
- 打印本文 关闭窗口