`
wsql
  • 浏览: 12260987 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

asp 增删改 拍卖后台

 
阅读更多
<!--#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">&nbsp;</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,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


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">&nbsp;<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">&nbsp;<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">&nbsp;<textarea name="word" cols="40" rows="9"></textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#E8F1F8">是否上架:</td>
<td bgcolor="#F2F7FB">&nbsp;<input name="isok" type="radio" id="isok" value="1" checked="checked" />上架
&nbsp; <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="确 定 添 加" />
&nbsp; &nbsp;
<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<input name="isok" type="radio" id="isok" value="1" checked="checked" />上架
&nbsp; <input type="radio" name="isok" id="isok" value="0" />下架
</td>
<%else%>
<td bgcolor="#F2F7FB">&nbsp;<input name="isok" type="radio" id="isok" value="1" />上架
&nbsp; <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="确 定 添 加" />
&nbsp; &nbsp;
<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>&nbsp;&nbsp;
<a href="?action=edit&id=<%=rs("ID")%>">修改</a>&nbsp;<a href="?action=del&id=<%=rs("ID")%>" onClick="return confirm('删除后无法恢复!确认删除?');">&nbsp;删</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 %>页&nbsp;
<% if page<>1 then %>
<a href="?page=1&classid=<%= classid %>&diy=<%= diy %>">首页</a>
<% else %>
首页
<% end if %>
&nbsp;
<% if page>1 then %>
<a href="?page=<%= page-1 %>&classid=<%= classid %>&diy=<%= diy %>">上一页</a>
<% else %>
上一页
<% end if %>
&nbsp;
<% if page<rs.pagecount then %>
<a href="?page=<%= page+1 %>&classid=<%= classid %>&diy=<%= diy %>">下一页</a>
<% else %>
下一页
<% end if %>
&nbsp;
<% if page<rs.pagecount then %>
<a href="?page=<%=rs.pagecount%>&classid=<%= classid %>&diy=<%= diy %>">末页</a>
<% else %>
末页
<% end if %>
&nbsp;总数<%= rs.recordcount %>条&nbsp; 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增删改插-完整版.zip

    本文将详细解析"ASP增删改插-完整版.zip"中的核心知识点,包括ASP的基础概念、增删改查操作的实现以及在实际应用中的实践。 一、ASP基础 ASP是构建Web应用程序的一种技术,它允许开发者使用HTML、VBScript或...

    asp制作的增删改网页

    【ASP技术介绍】 ASP(Active Server Pages)是微软推出的一种服务器端脚本环境,..."asp制作的增删改网页"这样的项目,正是这种基础知识的最佳实践实例,尽管它可能较为基础,但对于初学者来说,是一个很好的起点。

    ASP.NET MVC Linq to SQL 实现数据库增删改(源代码)ASP.NET MVC Linq to SQL 实现数据库增删改(源代码) ASP.NET MVC 分页控件

    在这个项目中,我们将深入探讨如何在ASP.NET MVC中利用Linq to SQL来实现数据库的增、删、改操作,并结合分页控件提升用户体验。 首先,我们需要创建一个数据上下文类,这个类继承自System.Data.Linq.DataContext,...

    easyui增删改很好的例子

    在后台,描述中提到使用了.NET技术,这可能是指ASP.NET或ASP.NET MVC,它们是Microsoft开发的服务器端框架,用于构建Web应用。通常,EasyUI与后端的交互通过AJAX完成,发送HTTP请求至服务器进行数据的CRUD操作。在...

    简单是mvc增删改程序

    本项目“简单是mvc增删改程序”显然旨在为初学者提供一个基础的教程,帮助他们理解和掌握如何在ASP.NET MVC环境中进行数据操作,如添加、删除和修改记录。以下是关于这个主题的详细知识解释: 1. **ASP.NET MVC架构...

    mvc ajax 增删改

    本压缩包文件提供了基于`Mvc`(即ASP.NET MVC)和`Ajax`实现的增删改功能示例,便于开发者快速理解和应用。 **MVC架构** MVC是一种设计模式,它将应用程序分为三个主要部分:模型(Model)、视图(View)和控制器...

    Ext.net后台分页增删改

    在"Ext.NET后台分页增删改"这个主题中,我们将探讨如何利用Ext.NET实现数据库后台分页、树形视图操作以及Grid面板的CRUD(创建、读取、更新和删除)功能。 首先,让我们深入了解一下后台分页。在Ext.NET中,为了...

    Asp.Net实现增删改以及分页例子一

    开发环境:Microsoft Visual Studio .NET 2003 数据库:SQL Server 2000 博文链接:https://fuhao9611.iteye.com/blog/74998

    mvc4增删改

    在“增删改”操作中,控制器可能会有如下的方法:`Create()`(创建新记录)、`Edit()`(编辑记录)、`Delete()`(删除记录)等。 **4. 数据库操作(SQL Server)** 在MVC4应用中,通常会使用SQL Server作为后端...

    asp.net的登录注册增删改

    在这个“asp.net的登录注册增删改”项目中,我们将深入探讨如何利用ASP.NET和SQL Server来实现用户管理的基本功能。 首先,登录注册系统是任何Web应用的核心部分。在ASP.NET中,我们可以使用内置的身份验证...

    asp.net页面增删改数据easyui

    在这个主题中,“asp.net页面增删改数据easyui”指的是使用ASP.NET MVC或Web Forms与EasyUI结合,实现对数据的添加、删除、修改操作。我们将从以下几个方面来深入探讨这个知识点: 1. **EasyUI介绍**: EasyUI是...

    ,MVC2与EF(Entity Framework)实现增删改的实例

    标题中的"MVC2与EF(Entity Framework)实现增删改的实例"是指在Visual Studio 2010中使用ASP.NET MVC 2框架结合Entity Framework进行数据操作的一个实践教程。描述中提到,这是一个针对初学者的入门教程,目的是帮助...

    linp三层增删改源码

    总结,"linp三层增删改源码"是一个实现基本CRUD功能的三层架构示例,通过分析上述文件,我们可以深入理解如何在ASP.NET环境中利用三层架构组织代码,处理数据库操作。这不仅对学习三层架构有帮助,也对实际项目开发...

    ASP与Access数据库_Demo 登录 增删改 分页

    在本Demo中,ASP被用来实现用户登录、数据的增删改查以及分页查询功能。 Access数据库是微软提供的一个关系型数据库管理系统(RDBMS),它以mdb或accdb为文件格式,适合小型到中型企业级应用。在ASP应用中,Access...

    asp树操作实例(增删改拖拽)

    5. **操作接口**:在ASP中创建处理增删改请求的页面,例如`addNode.asp`、`deleteNode.asp`、`editNode.asp`。根据HTTP请求参数,执行相应的数据库操作。 6. **拖拽操作**:在zTree的配置中开启拖拽功能,并定义...

    数据库底层操作(增删改)asp.net1.1

    数据库底层操作,调用相当简单,可以完成Sql、Oracle数据的增、删、改、执行存储过程功能,所有封装的方法请看文件"ConcSoft.Database.TXT",调用事例请看"调用ConcSoft.Database.dll事例.TXT",带日志追踪

    asp 初学者 (增删改) access 数据库

    ASP(Active Server Pages)是一种微软开发的服务器端脚本语言,常用于构建动态网页。对于初学者来说,理解和掌握ASP的基础知识以及如何与Access数据库进行交互是至关重要的。Access数据库则是一个小型、易于管理的...

    简单的Asp,net增查删改

    在Asp.net开发中,增查删改(CRUD,Create, Read, Update, Delete)是最基础也是最常用的操作,通常涉及到与数据库的交互。在这个项目中,开发者没有附带数据库文件,但提供了代码示例,暗示我们可以通过自己的方式...

Global site tag (gtag.js) - Google Analytics