📄 area_add.jsp
字号:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.gmdq.user.AreaManager,java.util.*"%>
<%@ page import="com.gmdq.entitybeans.*" %>
<!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>
<title>部门管理</title>
<%@ include file="/common/meta.jsp"%>
<link href="<c:url value='/css/comm.css'/>" rel="stylesheet" type="text/css">
<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
</head>
<%
String areaId=request.getParameter("areaId");
System.out.println("&&&&"+areaId);
AreaManager areaManager=new AreaManager(request);
String doType= request.getParameter("doType");
if(doType!=null)
{
if(doType.equals("add"))
{
areaManager.addArea(request);
response.sendRedirect("area.jsp");
}
if(doType.equals("update"))
{
areaManager.updateArea(request);
response.sendRedirect("area.jsp");
}
}
%>
<body>
<div id="content">
<form id="inputForm" action="area_add.jsp" method="post">
<table width="68%" border="1" align="center">
<%
if(areaId!=null &&!areaId.equals("")){
ADArea area=areaManager.getAreaByID(Integer.parseInt(areaId));
%>
<tr>
<td width="20%">部门名称</td>
<td>
<input name="doType" type="hidden" value="update"/>
<input name="areaid" type="hidden" value="<%=area.getAreaid()%>"/>
<input type="text" name="areaname" size="40" value="<%=area.getAreaName()%>" style="width:60%"/></td>
</tr>
<tr>
<td>状态</td>
<td>
<select name="status">
<option value="-1">请选择</option>
<%
if(area.getStatus()==1)
{
%>
<option value="1" selected>启用</option>
<option value="0">停用</option>
<%
}else
{
%>
<option value="1">启用</option>
<option value="0" selected>停用</option>
<%
}
%>
</select>
</td>
</tr>
<%}else{%>
<tr>
<td width="20%">部门名称</td>
<td>
<input name="doType" type="hidden" value="add"/>
<input type="text" name="areaname" size="40" id="areaname" style="width:60%"/></td>
</tr>
<tr>
<td>状态</td>
<td>
<select name="status">
<option value="-1">请选择</option>
<option value="1">启用</option>
<option value="0">停用</option>
</select>
</td>
</tr>
<%}%>
<tr>
<td colspan="2" align="center">
<input type="submit" value="提交"/>
<input type="button" value="取消" onclick="history.back()"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -