/*
* @项目名称:OLS
* @创建日期 2006-7-13
* @author: 孔垂云
* @开发团队:北京交通大学经济管理学院
* @version:1.0
*/
package com.ols.ebank.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ols.ebank.vo.*;
import com.ols.ebank.bean.*;
import com.ols.util.*;
import com.ols.eshop.bean.OrderBean;
public class AccountServlet extends HttpServlet
{
/**
* Constructor of the object.
*/
public AccountServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String action = request.getParameter("action");
/*
* 在注册账户时,把取得的账户的一般信息保存在session中,然后跳转到下一个界面
* 当同意并遵从银行交易协议后,点击下一步进入注册账户的界面
* 1、填写注册的基本信息,需要javascript验证,其中身份证号、姓名、登陆密码不能为空,登陆密码与再次输入登陆密码得相同,身份证号只能为数字且只能为15位或18位
* 2、当满足以上要求后点击下一步需要完成如下工作
* 1)验证身份证号是否存在,如果存在跳转到错误界面,提示一个身份证号只能注册一个网上银行帐户
* 2)把用户已经提交的信息保存在AccountVO对象中,并把这个对象保存在Session中
* 3)判断session值card1和card2是否为空,如果不为空,则跳转到regist3页面,如果为空,则生成两个银行卡的卡号
* 4)生成银行卡的规则是“999”+年月日+七位随机数,这样基本可以保证不会有重复的银行卡号,把生成的两个银行卡号保存在session中,跳转到regist3界面
*/
/*注册银行账户
* 1、保证一个学号只能注册一个银行帐号
* 2、身份证号唯一
*
*/
if (action.equalsIgnoreCase("reg1")) {
if (request.getSession().getAttribute("stu_id") == null) {
response.setCharacterEncoding("gb2312");
PrintWriter out = response.getWriter();
out.println("<script language='javascript'>alert('连接超时,请重新登陆');window.navigate('../index.jsp');</script>");
}
else {
try {
int stu_id = Integer.parseInt(String.valueOf(request.getSession().getAttribute("stu_id")));
//判断一个学号只能注册一个银行帐号
AccountBean accountBean = new AccountBean();
int flag = accountBean.checkBankAcc(stu_id);
if (flag > 0)
response.sendRedirect("error.jsp?msg=accMore");
else {
String acc_idnum = request.getParameter("acc_idnum");
flag = accountBean.checkIDNum(acc_idnum);
if (flag > 0)
response.sendRedirect("error.jsp?msg=accexist");
else {
String acc_realname = request.getParameter("acc_realname");
String acc_loginpwd = request.getParameter("acc_loginpwd");
String acc_address = request.getParameter("acc_address");
String acc_phone = request.getParameter("acc_phone");
String acc_zip = request.getParameter("acc_zip");
AccountVO accountVO = new AccountVO();
accountVO.setAcc_idnum(acc_idnum);
accountVO.setStu_id(stu_id);
accountVO.setAcc_realname(acc_realname);
accountVO.setAcc_loginpwd(acc_loginpwd);
accountVO.setAcc_phone(acc_phone);
accountVO.setAcc_address(acc_address);
accountVO.setAcc_zip(acc_zip);
accountVO.setAcc_regdate(StringUtil.getSystemTime());
accountVO.setAcc_lastlogintime(StringUtil.getSystemTime());
int flag1 = accountBean.regAccount(accountVO);
int s=Integer.parseInt(String.valueOf(request.getSession().getAttribute("stu_id")));
TeacherBean teaBean=new TeacherBean();
teaBean.updateStuP(s,"p1");
if (flag1 == 0)
response.sendRedirect("error.jsp?msg=dberr");
else
response.sendRedirect("regist4.jsp");
}
}
}
catch (NumberFormatException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
else if(action.equalsIgnoreCase("reg2"))
{
if (request.getSession().getAttribute("stu_id") == null) {
response.setCharacterEncoding("gb2312");
PrintWriter out = response.getWriter();
out.println("<script language='javascript'>alert('连接超时,请重新登陆');window.navigate('../index.jsp');</script>");
}
else
{
try {
int stu_id = Integer.parseInt(String.valueOf(request.getSession().getAttribute("stu_id")));
//判断一个学号只能注册一个银行帐号
AccountBean accountBean = new AccountBean();
int flag = accountBean.checkBankAcc(stu_id);
if (flag > 0)
response.sendRedirect("error.jsp?msg=accMore");
else {
response.sendRedirect("regist2.jsp");
}
}
catch (NumberFormatException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
//在申请卡号时生成卡号,转到申请卡号的界面
else if (action.equalsIgnoreCase("regCard1")) {
if (request.getSession().getAttribute("acc_idnum") == null){
response.setCharacterEncoding("gb2312");
PrintWriter out = response.getWriter()
没有合适的资源?快使用搜索试试~ 我知道了~
网络支付与结算实验系统
共980个文件
jpg:263个
class:190个
java:164个
3星 · 超过75%的资源 需积分: 7 22 下载量 10 浏览量
2008-11-14
09:06:45
上传
评论
收藏 12.01MB ZIP 举报
温馨提示
网络支付与结算实验系统 电子商务实验必备
资源详情
资源评论
资源推荐
收起资源包目录
网络支付与结算实验系统 (980个子文件)
menu.js.bak 9KB
status.jsp.bak 2KB
无标题.bmp 44KB
success.bmp 44KB
TeacherServlet.class 45KB
EfutServlet.class 35KB
Efut_bargainDataBean.class 23KB
ExcModelBean.class 18KB
Efut_orderBean.class 18KB
AccountServlet.class 18KB
SmartUpload.class 16KB
Efut_modelBean.class 15KB
ExchangeServlet.class 15KB
tea_005ffutSetting_jsp.class 15KB
index_jsp.class 14KB
EBankAdminServlet.class 13KB
Efut_accountBean.class 12KB
orderCheck_jsp.class 12KB
updateInfo_jsp.class 12KB
ProductBean.class 12KB
version_jsp.class 12KB
AccountBean.class 12KB
regEshop_jsp.class 11KB
updatePwd_jsp.class 11KB
orderLogin_jsp.class 11KB
regist1_jsp.class 11KB
transferBalance_jsp.class 11KB
tea_005fshowStudent_jsp.class 11KB
EorderBean.class 10KB
proMan_jsp.class 10KB
regist2_jsp.class 10KB
question_jsp.class 10KB
AccountBean.class 10KB
regCard1_jsp.class 10KB
CardBean.class 10KB
myOrderList_jsp.class 10KB
shopCar_jsp.class 10KB
regCard2_jsp.class 10KB
TeacherBean.class 10KB
tea_005fquestion_jsp.class 9KB
ordMan_jsp.class 9KB
que_005fquery_jsp.class 9KB
proInfo_jsp.class 9KB
onLineBargin_jsp.class 9KB
tea_005fshowExp_jsp.class 9KB
adm_005fshowTeacher_jsp.class 9KB
myPayee_jsp.class 9KB
MyAccountBean.class 9KB
MD5.class 9KB
queryDayResult_jsp.class 8KB
queryHistoryResult_jsp.class 8KB
queryHistoryOperation_jsp.class 8KB
queryEshopOperation_jsp.class 8KB
tea_005fshowSyjd_jsp.class 8KB
stu_005fupdatePwd_jsp.class 8KB
tea_005fshowMessage_jsp.class 8KB
tea_005fsetting_jsp.class 8KB
orderSendInfo_jsp.class 8KB
ShopCarServlet.class 8KB
addQuestion_jsp.class 8KB
accMan_jsp.class 8KB
mes_005fallMessage_jsp.class 8KB
ebank_jsp.class 8KB
topProduct_jsp.class 8KB
mes_005fdetail_jsp.class 7KB
updateMyPayee_jsp.class 7KB
StudentServlet.class 7KB
singleInfo_jsp.class 7KB
orderPaywayUpdate_jsp.class 7KB
orderSendwayUpdate_jsp.class 7KB
adm_005faddTeacher_jsp.class 7KB
index_jsp.class 7KB
updatePwd_jsp.class 7KB
tea_005freplyQuestion_jsp.class 7KB
adm_005fupdatePwd_jsp.class 7KB
tea_005fadmin_jsp.class 7KB
MyAccountServlet.class 7KB
error_jsp.class 7KB
OrderBean.class 7KB
addMyPayee_jsp.class 7KB
tea_005faddMessage_jsp.class 7KB
stu_005fsubExp_jsp.class 7KB
DBConnectionManager.class 7KB
orderSendway_jsp.class 7KB
que_005fdetail_jsp.class 7KB
queryDayOperation_jsp.class 7KB
orderPayway_jsp.class 7KB
queryBalance_jsp.class 7KB
tea_005fupdatePwd_jsp.class 7KB
orderSuccess_jsp.class 7KB
status_jsp.class 7KB
QuestionServlet.class 7KB
QuestionBean.class 6KB
ProductServlet.class 6KB
catMan_jsp.class 6KB
left_jsp.class 6KB
login_jsp.class 6KB
updatePWD_jsp.class 6KB
ebankMain_jsp.class 6KB
admMan_jsp.class 6KB
共 980 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
zhurisoft2006
- 粉丝: 2
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1