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

📄 buy.jsp

📁 这是云网OA2.0源码,里面包括公文管理
💻 JSP
字号:
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="cn.js.fan.util.*"%>
<%@ page import="cn.js.fan.db.*"%>
<%@ page import="cn.js.fan.web.*"%>
<%@ page import="com.redmoon.forum.plugin.auction.*"%>
<%@ page import="com.redmoon.forum.person.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="../../../common.css" type=text/css rel=stylesheet>
<title>出价</title>
<style type="text/css">
<!--
body {
	margin-top: 0px;
	margin-left: 0px;
	margin-right: 0px;
}
.style1 {
	color: #525252;
	font-weight: bold;
}
-->
</style></head>
<body>
<%@ include file="../../inc/header.jsp"%>
<jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<%
if (!privilege.isUserLogin(request)) {
	out.print(StrUtil.Alert_Back("请先登录!"));
	return;
}

int worthId = 0;
int count = 0;
try {
	worthId = ParamUtil.getInt(request, "worthId");
	count = ParamUtil.getInt(request, "count");
	if (count<=0)
		throw new ErrMsgException("数量必须大于0!");
}
catch (ErrMsgException e) {
	out.print(StrUtil.Alert_Back("数据格式错误!")); // StrUtil.Alert_Back(e.getMessage()));
	return;
}
AuctionWorthDb aw = new AuctionWorthDb();
aw = aw.getAuctionWorthDb(worthId);

AuctionDb ad = new AuctionDb();
ad = ad.getAuctionDb(aw.getMsgRootId());

if (ad.getCount()<count) {
	out.print(SkinUtil.makeErrMsg(request, "对不起,你要买的数量超过了销售数量!"));
	return;
}

if (ad.getUserName().equals(privilege.getUser(request))) {
	out.print(StrUtil.Alert_Back("对不起,您自己不能购买!"));
	return;
}

boolean re = false;
AuctionOrderDb ao = new AuctionOrderDb();
try {
	re = ao.makeOrderForSell(aw, privilege.getUser(request), count);
}
catch (ErrMsgException e) {
	out.print(StrUtil.Alert_Back(e.getMessage()));
}
catch (ResKeyException e1) {
	out.print(StrUtil.Alert_Back(e1.getMessage(request)));
}
if (re)
	out.print(StrUtil.Alert_Redirect("购买完成,点击查看生成的订单!", "showorder.jsp?orderId=" + ao.getId()));
%>
</body>
</html>

⌨️ 快捷键说明

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