📄 permissionedit.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" pageEncoding="gb2312"%>
<%@ page import ="entity.*" %>
<%@ page import ="service.*" %>
<%@ page import ="java.util.List" %>
<%@ include file="Permission.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>权限添加、修改</title>
</head>
<%
Permission entity=new Permission();
Object[] obj=new Object[4];
Object[] objUG=new Object[2];
List list=null;
String intID=request.getParameter("ID");
if (null==request.getParameter("Submit")){
if (null!=intID){
if(!Action.hasPermission(8,Util.OP_EDIT,allPermissions))
return;
list=entity.select("select strPName,intResID,setOperation,intIsAnonymous from Permission where intPID="+intID);
if(list.size()>0)
obj=(Object[])list.get(0);
}
else if(!Action.hasPermission(8,Util.OP_ADD,allPermissions))
return;
}else{
entity.setStrPName(request.getParameter("strPName"));
entity.setIntResID(Integer.valueOf(request.getParameter("intResID")));
entity.setIntIsAnonymous(Integer.valueOf(request.getParameter("intIsAnonymous")));
String requestSetOperation[]=request.getParameterValues("setOperation");
StringBuffer setOperation=new StringBuffer();
if (requestSetOperation!=null){
for (int i=0;i<requestSetOperation.length;i++)
setOperation.append(requestSetOperation[i]).append(",");
setOperation.deleteCharAt(setOperation.length()-1);
}
entity.setSetOperation(setOperation.toString());
if (intID.length()>0){
entity.setIntPID(Integer.valueOf(intID));
entity.update();
}
else
entity.insert();
response.sendRedirect("PermissionList.jsp");
return;
}
%>
<body>
<form action="" name="form1">
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="17%" height="25" bgcolor="#C3C3C3">权限名:</td>
<td width="83%" bgcolor="#E0E0E0"><input name="strPName" type="text" id="strPName" value="<%=Util.obj2str(obj[0])%>"></td>
</tr>
<tr>
<td height="25" bgcolor="#C3C3C3">资源:</td>
<td bgcolor="#E0E0E0"><select name="intResID" id="intResID">
<%list=entity.select("select intResID,strResName from Resource");
for(int i=0;i<list.size();i++){
objUG=(Object[])list.get(i);%>
<option value="<%=objUG[0]%>"><%=objUG[1]%></option>
<%}%>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#C3C3C3">操作类型:</td>
<td bgcolor="#E0E0E0">
<input name="setOperation" type="checkbox" id="setOperation0" value="0">
<label for="setOperation0">查看</label>
<input name="setOperation" type="checkbox" id="setOperation1" value="1">
<label for="setOperation1">添加</label>
<input name="setOperation" type="checkbox" id="setOperation2" value="2">
<label for="setOperation2">修改</label>
<input name="setOperation" type="checkbox" id="setOperation3" value="3">
<label for="setOperation3">删除</label> </td>
</tr>
<tr>
<td height="25" bgcolor="#C3C3C3">是否公用:</td>
<td bgcolor="#E0E0E0"><select name="intIsAnonymous" id="intIsAnonymous">
<option value="0">否</option>
<option value="1">是</option>
</select></td>
</tr>
<tr>
<td height="50" bgcolor="#C3C3C3"> </td>
<td bgcolor="#E0E0E0"> <input type="submit" name="Submit" value=" 提 交 ">
<input type="reset" name="Submit2" value=" 重 置 "> <input name="ID" type="hidden" id="ID" value="<%=Util.obj2str(intID)%>">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -