dictionary_countryedit.jsp
来自「java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理」· JSP 代码 · 共 148 行
JSP
148 行
<%@ include file="../../include/configuration.jsp"%>
<%@ include file="../../include/authorizemanager.jsp"%>
<%@ page import="com.vere.dictionary.bean.*"%>
<%@ page import="com.vere.dictionary.item.*"%>
<%@ page import="com.vere.dictionary.xml.*"%>
<%@ page contentType="text/html; charset=gb2312" %>
<%
SessionFactory sessionFactory=(SessionFactory)session.getAttribute("sessionFactory");
String message="";
ParameterUtils.setCharacterEncoding(request);
String status=ParameterUtils.getString(request,"status");
//修改
if(status.equals("edit"))
{
String id=ParameterUtils.getString(request,"id");//编号
String id_no=ParameterUtils.getString(request,"id_no");//
String country_cn_name=ParameterUtils.getString(request,"country_cn_name");//国家中文名称
String country_en_name=ParameterUtils.getString(request,"country_en_name");//国家英文名称
if(country_cn_name==null||country_cn_name.equals("")){
out.print("country_cn_name 国家中文名称不能为空");
return;
}
if(country_en_name==null||country_en_name.equals("")){
out.print("country_en_name 国家英文名称不能为空");
return;
}
Dictionary_countryItem item=new Dictionary_countryItem();
item.setId(id);
item.setId_no(id_no);
item.setCountry_cn_name(country_cn_name);
item.setCountry_en_name(country_en_name);
Dictionary_countryBean bean=new Dictionary_countryBean();
boolean b=bean.updateItem(item);
if(b)
{
Dictionary_countryXmlBean xmlBean=new Dictionary_countryXmlBean();
xmlBean.updateXmlItem(item);
}
if(b){
message="1";
}
}
String id=ParameterUtils.getString(request,"id");
Dictionary_countryBean bean=new Dictionary_countryBean();
Dictionary_countryItem item=bean.find(id);
%>
<html>
<head>
<title><%=titleName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../js/check.js"></script>
<link href="../../css/date.css" rel="stylesheet" type="text/css">
<script src="../../js/ShowDate.js"></script>
<script language="javascript">
init();
</script>
</head>
<script language="javascript">
function back()
{
location="dictionary_country.jsp";
}
function Check()
{
var form=form1;
if(!isIntegerPlus(form.id_no.value))
{
alert("编号必须为整数!");
form.id_no.focus();
return;
}
if(form.country_cn_name.value=="")
{
alert("请输入国家中文名称!");
form.country_cn_name.focus();
return;
}
if(form.country_en_name.value=="")
{
alert("请输入国家英文名称!");
form.country_en_name.focus();
return;
}
form.status.value="edit";
form.submit();
}
</script>
<body>
<form action="" method="post" name="form1">
<table class="firsttable">
<tr>
<td align="center" valign="top">
<table class="centertable">
<tr>
<td></td>
</tr>
<tr>
<td align="center" class="addborder">
<table class="addTable">
<tr align="center" >
<td colspan="2">
<font class="message">
<%
if(message.equals("1"))
{
out.println("修改成功:继续");
}
%>
</font>
</td>
</tr>
<tr >
<td >编号:</td>
<td ><input name="id_no" type="text" id="id_no" value="<%=item.getId()%>" ></td>
</tr>
<tr >
<td >国家中文名称:</td>
<td ><input name="country_cn_name" type="text" id="country_cn_name" value="<%=item.getCountry_cn_name()%>"></td>
</tr>
<tr >
<td >国家英文名称:</td>
<td ><input name="country_en_name" type="text" id="country_en_name" value="<%=item.getCountry_en_name()%>"></td>
</tr>
<tr >
<td colspan="2" align="center">
<input name="Button" type="button" class="button" onClick="Check()" value="确定">
<input name="Submit2" type="button" class="button" onClick="back()" value="返回">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="status" >
<input type="hidden" name="id" value=<%=id%>>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?