<!--#include file="../conn/conn.asp"-->
<%
dim action, title, price, desc, isonsale,insertsql, updatesql, isonsalesql, delsql, recaffected, itemid, editid
action = Trim(request.QueryString("action"))
itemid = Trim(request.QueryString("ID"))
diy=Trim(Request.QueryString("diy"))
editid = Trim(request.Form("eitemid"))
set rs=server.CreateObject("ADODB.Recordset")
title=trim(request.Form("topic"))
price = trim(request.Form("price"))
desc = trim(request.Form("word"))
isonsale = request.Form("isok")
if isonsale = "1" then
isonsale=True
else
isonsale=False
end if
page=Trim(Request.QueryString("page"))
if page="" then
page=0
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>项目管理系统 by www.tcshw.com-QQ:459942416</title>
<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.tabfont01 {
font-family: "宋体";
font-size: 9px;
color: #555555;
text-decoration: none;
text-align: center;
}
.font051 {font-family: "宋体";
font-size: 12px;
color: #333333;
text-decoration: none;
line-height: 20px;
}
.font201 {font-family: "宋体";
font-size: 12px;
color: #FF0000;
text-decoration: none;
}
.button {
font-family: "宋体";
font-size: 14px;
height: 37px;
}
html { overflow-x: auto; overflow-y: auto; border:0;}
</style>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="62" background="images/nav04.gif">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="21" align="right">■</td>
<td width="538" class="dhfont01">拍卖管理</td>
<td width="144" align="left"> </td>
</tr>
</table></td>
</tr>
</table>
<%
if conn.State = 0 then
conn.Open()
end if
'删除操作
if action = "del" then
delsql = "delete from [pm] where ID="&itemid
on error resume next '错误处理conn.Execute delsql,recaffectedIf Err.Number <> 0 ThenResponse.Write (Err.Description& "<br><br>")Response.Write("This means there is most likely a problem with the" & vbCrLf)Response.Write("""ConnectionString"" info that you specified.<br>" & vbCrLf)Response.Endelseresponse.Write "<script>alert('add success !');</script>"end ifconn.close
end if
if action="isok" then '下架处理
isonsalesql = "update [pm] set [isonsale]="&isonsale&" where ID="&itemid
on error resume next
conn.Execute isonsalesql,recaffected
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
Response.Write("This means there is most likely a problem with the" & vbCrLf)
Response.Write("""ConnectionString"" info that you specified.<br>" & vbCrLf)
Response.End
else
response.Write "<script>alert('add success !');</script>"
end if
conn.close
end if
%>
<table id="subtree1" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
if action="add" then '添加或修改, 标志是是否有记录ID
if title<>"" and price<>"" then '如果为空则初始化窗口桌面.if editid = "" then '添加操作
insertsql = "insert into [pm] ([QQ], [title], [price], [description], [isonsale]) values(' ','"&title&"',"&price&",'"&desc&"',"&isonsale&")"
on error resume next
conn.Execute insertsql,recaffected
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
Response.Write("This means there is most likely a problem with the" & vbCrLf)
Response.Write("""ConnectionString"" info that you specified.<br>" & vbCrLf)
Response.End
else
response.Write "<script>alert('add success !');</script>"
Response.End
end if
conn.close
else '修改操作
updatesql = "update [pm] set [title]='"&title&"', [price]="&price&", [description]='"&desc&"', [isonsale]="&isonsale&" where ID="&editid
on error resume next
conn.Execute updatesql,recaffected
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
Response.Write("This means there is most likely a problem with the" & vbCrLf)
Response.Write("""ConnectionString"" info that you specified.<br>" & vbCrLf)
Response.End
else
response.Write "<script>alert('update success !');</script>"
Response.End
end if
conn.close
end if
end if
%>
<!--新增记录,窗口初始化-->
<form name="form1" method="post" action="?action=add" onSubmit="javascript:return checkform();">
<input id="eitemid" name="eitemid" type="hidden" value=""><!--这里的input隐藏控件必须放在form中-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgColor=#b8d9f6>
<tr>
<td height="40" colspan="2" align="center" bgcolor="#8DC6E0" class="dhfont01"><strong>添加拍卖</strong>
</td>
</tr>
<tr>
<td width="150" height="25" align="right" bgcolor="#E8F1F8">拍卖标题:</td>
<td bgcolor="#F2F7FB"> <input name="topic" type="text" id="topic" size="40" maxlength="255" value="" /></td>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">当前价格:</td>
<td bgcolor="#F2F7FB"> <input name="price" type="text" id="price" size="4" maxlength="8" value="" />
元</td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">拍卖描述:</td>
<td bgcolor="#F2F7FB"> <textarea name="word" cols="40" rows="9"></textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">是否上架:</td>
<td bgcolor="#F2F7FB"> <input name="isok" type="radio" id="isok" value="1" checked="checked" />上架
<input type="radio" name="isok" id="isok" value="0" />下架
</td>
</tr>
<tr>
<td height="45" colspan="2" align="center" bgcolor="#E8F1F8"><input name="button" type="submit" class="dhbutton01" id="button" value="确 定 添 加" />
<input name="button2" type="reset" class="dhbutton02" id="button2" value="重 新 填 写" /></td>
</tr>
</table>
</form>
<%end if
if action= "edit" then '进行修改操作时,对界面进行初始化
sql="select * from [pm] where ID="&itemid
if conn.State= 0 then
conn.Open()
end if
rs.open sql,conn
%><!--修改记录,窗口初始化-->
<form name="form1" method="post" action="?action=add" onSubmit="javascript:return checkform();">
<input id="eitemid" name="eitemid" type="hidden" value="<%=itemid%>">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgColor=#b8d9f6>
<tr>
<td height="40" colspan="2" align="center" bgcolor="#8DC6E0" class="dhfont01"><strong>添加拍卖</strong>
</td>
</tr>
<tr>
<td width="150" height="25" align="right" bgcolor="#E8F1F8">拍卖标题:</td>
<td bgcolor="#F2F7FB"> <input name="topic" type="text" id="topic" size="40" maxlength="255" value="<%=rs("title")%>" /></td>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">当前价格:</td>
<td bgcolor="#F2F7FB"> <input name="price" type="text" id="price" size="4" maxlength="8" value="<%=rs("price")%>" />
元</td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">拍卖描述:</td>
<td bgcolor="#F2F7FB"> <textarea name="word" cols="40" rows="9"><%=rs("description")%></textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">是否上架:</td>
<%if rs("isonsale")=True then%>
<td bgcolor="#F2F7FB"> <input name="isok" type="radio" id="isok" value="1" checked="checked" />上架
<input type="radio" name="isok" id="isok" value="0" />下架
</td>
<%else%>
<td bgcolor="#F2F7FB"> <input name="isok" type="radio" id="isok" value="1" />上架
<input type="radio" name="isok" id="isok" value="0" checked="checked" />下架
</td>
<%end if%>
</tr>
<tr>
<td height="45" colspan="2" align="center" bgcolor="#E8F1F8"><input name="button" type="submit" class="dhbutton01" id="button" value="确 定 添 加" />
<input name="button2" type="reset" class="dhbutton02" id="button2" value="重 新 填 写" /></td>
</tr>
</table>
</form>
<!--添加拍卖结束-->
<%
end if
if action="list" or action="isok" or action="del" or action="edit" then
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from [pm]"
if conn.State= 0 then
conn.Open()
end if
rs.open sql,conn
rs.pagesize=15
if rs.bof then
Response.Write("<center>")
Response.Write("<BR><BR>")
Response.Write("没找到相关信息")
Response.Write("<BR><BR>")
Response.Write("</center>")
else
page=cint(page)
if page<1 then
page=1
elseif page>rs.pagecount then
page=rs.pagecount
else
end if
end if
rs.AbsolutePage=page
%>
<!--拍卖列表-->
<TABLE width=800 align="center" cellPadding=1 cellSpacing=1 bgColor=#b8d9f6>
<TBODY>
<TR>
<TD width="15" align="left" bgColor=#8DC6E0 >ID</TD>
<TD width="20" align="left" bgColor=#8DC6E0 ><STRONG>QQ</STRONG> </TD>
<TD width="150" align="left" bgColor=#8DC6E0 ><STRONG>标题</STRONG> </TD>
<TD width="50" align="center" bgColor=#8DC6E0 ><STRONG>拍卖价格</STRONG> </TD>
<TD width="100" align="center" bgColor=#8DC6E0 ><strong>描述</strong></TD>
<TD width="30" align="center" bgColor=#8DC6E0 ><strong>状态</strong></TD>
<TD width="70" align="center" bgColor=#8DC6E0 ><strong>操作</strong></TD>
</TR>
<%
for news=1 to rs.pagesize
IF rs.EOF then EXIT FOR
%>
<TR>
<TD bgColor=#F0F7FB align="center"><%=rs("ID")%></TD>
<TD bgColor=#F0F7FB align="left"><%=rs("QQ")%></TD>
<TD align="center" bgColor=#F0F7FB><STRONG><%=rs("title")%></STRONG> </TD>
<TD bgColor=#F0F7FB align="center"><%=rs("price")%></TD>
<TD bgColor=#F0F7FB align="center"><%=rs("description")%></TD>
<TD bgColor=#F0F7FB align="center"><%=rs("isonsale")%></TD>
<TD bgColor=#F0F7FB align="center"><a href="?action=isok&id=<%=rs("ID")%>">下架</a>
<a href="?action=edit&id=<%=rs("ID")%>">修改</a> <a href="?action=del&id=<%=rs("ID")%>" onClick="return confirm('删除后无法恢复!确认删除?');"> 删</a>
</TD>
</TR>
<%
rs.MoveNext()
Next
%>
</TBODY>
</TABLE>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="32" align="center" bgcolor="#FFFFFF">第<%= page %>页
<% if page<>1 then %>
<a href="?page=1&classid=<%= classid %>&diy=<%= diy %>">首页</a>
<% else %>
首页
<% end if %>
<% if page>1 then %>
<a href="?page=<%= page-1 %>&classid=<%= classid %>&diy=<%= diy %>">上一页</a>
<% else %>
上一页
<% end if %>
<% if page<rs.pagecount then %>
<a href="?page=<%= page+1 %>&classid=<%= classid %>&diy=<%= diy %>">下一页</a>
<% else %>
下一页
<% end if %>
<% if page<rs.pagecount then %>
<a href="?page=<%=rs.pagecount%>&classid=<%= classid %>&diy=<%= diy %>">末页</a>
<% else %>
末页
<% end if %>
总数<%= rs.recordcount %>条 GO
<select name="select2" onChange="MM_jumpMenu('self',this,0)">
<%For m = 1 To rs.PageCount%>
<option value="?page=<%=m%>&classid=<%= classid %>&diy=<%= diy %>"<%if page=m then%>selected<%end if%>><%=m%></option>
<% Next %>
</select>
页
</td>
</tr>
</table>
<%
else
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<!--拍卖列表结束-->
<script language=javascript>
function checkform()
{
if(document.form1.topic.value=="" )
{
alert("拍卖名不能为空");
form1.sname.focus()
return false;
}
if(document.form1.price.value=="")
{
alert("拍卖价格不能为空");
form1.buynum.focus()
return false;
}
if(document.form1.word.value=="")
{
alert("拍卖描述不能为空");
form1.user1.focus()
return false;
}
}
</script>
</td>
</tr>
</table>
</body>
</html>
效果图:
源码:
分享到:
相关推荐
ASP增删改插-文章地址 https://blog.csdn.net/cplvfx/article/details/100582333
ASP.NET MVC Linq to SQL 实现数据库增删改(源代码)ASP.NET MVC Linq to SQL 实现数据库增删改(源代码) ASP.NET MVC 分页控件
asp.net页面增删改数据easyui,就摘取了主要的两个cshtml,2个c#
小弟上传的第一个资源,虽然很低级,但也是一片心意。。
简单的ASP.NET MVC增删改项目,SQL数据库
asp 初学者 (增删改) access 数据库
ASP动态网页 Access数据库 登录与增删改,支持分页查询,功能比较简单,请大家多多指教!
开发环境:Microsoft Visual Studio .NET 2003 数据库:SQL Server 2000 博文链接:https://fuhao9611.iteye.com/blog/74998
asp.net简单的mvc增删改查,适合初学者。
基于ztree官网开发文档自己根据项目页面需要自己学习了几天做出来的一个增删改 数据库也在里边
简单的ASP后台添删改查含数据库 比较易懂 不复杂
数据库底层操作,调用相当简单,可以完成Sql、Oracle数据的增、删、改、执行存储过程功能,所有封装的方法请看文件"ConcSoft.Database.TXT",调用事例请看"调用ConcSoft.Database.dll事例.TXT",带日志追踪
用asp.net和Sql开发的一个简单的登录注册和增删改的项目,适合新手
asp.net五层架构实现对GridView的增删改差
ASP NET C# 纯代码实现GridView绑定增删改
asp.net web的xml增删改排序操作。
VS12下REST风格的ASP.NET Web API框架实例。对list实现简单的增删改查。CRUD
自己实现的的asp.net对数据库基本操作