58,454
社区成员
发帖
与我相关
我的任务
分享
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%
String path = request.getContextPath();
%>
<!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="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css" />
<script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script language="javascript">
function check()
{
if(document.formupdate.code.value =="")
{
alert("防伪码不能为空");
return false;
}
if(document.formupdate.status.value =="")
{
alert("状态不能空");
return false;
}
document.formupdate.submit();
}
</script>
</head>
<body leftmargin="2" topmargin="9" background='<%=path %>/images/allbg.gif'>
<form action="<%=path %>/order?type=codeupdate" method="post" name="formupdate">
<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
<tr bgcolor="#EEF4EA">
<td colspan="2" background="<%=path %>/images/wbg.gif" class='title'><span> </span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="10%" bgcolor="#FFFFFF" align="right">
id:
</td>
<td width="90%" bgcolor="#FFFFFF">
<input type="text" value="${requestScope.C.id}" name="num" style="width: 250px;" />
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="10%" bgcolor="#FFFFFF" align="right">
防伪码:
</td>
<td width="90%" bgcolor="#FFFFFF">
<input type="text" value="${requestScope.C.code}" name="code" style="width: 250px;" />
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="10%" bgcolor="#FFFFFF" align="right">
状态:
</td>
<td width="90%" bgcolor="#FFFFFF">
<input type="text" value="${requestScope.C.status}" name="status"style="width: 250px;"/>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="10%" bgcolor="#FFFFFF" align="right">
</td>
<td width="90%" bgcolor="#FFFFFF">
<input type="button" value="修改" onclick="check()"/>
<input type="reset" value="重置"/>
<img id="indicator" src="<%=path %>/img/loading.gif" alt="Loading..." style="display:none"/>
</td>
</tr>
</table>
</form>
</body>
</html>
public void codeupdate(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
int code=Integer.parseInt(req.getParameter("code"));
String status =req.getParameter("status");
int num=Integer.parseInt(req.getParameter("num"));
String sql="update security_code set SC_SERIAL_NUMBER =? and SC_STATUS=? where SC_ID=?";
Object[] params={code,status,num};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("msg", "信息更新完毕");
String targetURL = "/common/msg.jsp";
dispatch(targetURL, req, res);
}