/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.yourcompany.struts.action;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import ms.hibernate.Popedom;
import ms.hibernate.Room;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.web.page.IPagination;
import com.model.DeptForm;
import com.model.IDeptDao;
import com.model.IEmpDao;
import com.model.IRoomDao;
import com.yourcompany.struts.form.EmpForm;
import com.yourcompany.struts.form.RoomForm;
/**
* MyEclipse Struts
* Creation date: 09-22-2007
*
* XDoclet definition:
* @struts.action parameter="control"
*/
public class ROManagerAction extends DispatchAction {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
private IEmpDao empDao;
private IPagination Pagination;
private IRoomDao roomDao;
private IDeptDao deptDao;
//机房列表
public ActionForward roomList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String curpage = request.getParameter("curpage");
HttpSession session = request.getSession(true);
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("main");
} else {
for (Iterator<Popedom> po = pope.iterator(); po.hasNext();) {
Popedom pos = po.next();
long temp = pos.getPopedomid();
if (temp == 10005) {
request.setAttribute("new", "Y");
}
if (temp == 10006) {
request.setAttribute("update", "Y");
}
if (temp == 10007) {
request.setAttribute("del", "Y");
}
}
List<RoomForm> dept = this.getRoomDao().findAllRoom();
request.setAttribute("map", this.getPagination().invoke(dept,
curpage));
return mapping.findForward("roomList");
}
}
}
//到增加页面
public ActionForward addRoom(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession(true);
boolean b = false;
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("error");
} else {
for (Iterator<Popedom> po = pope.iterator(); po.hasNext();) {
Popedom pos = po.next();
long temp = pos.getPopedomid();
if (temp == 10005) {
b = true;
break;
}
}
if (b == true) {
request.setAttribute("depts", this.getDeptDao().findAllDepts());
return mapping.findForward("addRoom");
} else {
request.setAttribute("error", "没有增加权限");
return mapping.findForward("error");
}
}
}
}
//增加
public ActionForward createNewRoom(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RoomForm roomForm = (RoomForm)form;
HttpSession session = request.getSession(true);
boolean b = false;
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("error");
} else {
for (Iterator<Popedom> po = pope.iterator(); po.hasNext();) {
Popedom pos = po.next();
long temp = pos.getPopedomid();
if (temp == 10005) {
b = true;
break;
}
}
if (b == true) {
if(this.getRoomDao().checkName(roomForm.getRname())==true){
if(this.getRoomDao().createNewRoom(roomForm, id)==true){
request.setAttribute("error", "新增成功");
}else{
request.setAttribute("error", "新增失败");
}
}else{
request.setAttribute("error", "新增失败 机房名被占用");
}
return mapping.findForward("roomListAction");
} else {
request.setAttribute("error", "没有增加权限");
return mapping.findForward("error");
}
}
}
}
//到更改页面
public ActionForward toUpdate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession(true);
boolean b = false;
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("error");
} else {
for (Iterator<Popedom> po = pope.iterator(); po.hasNext();) {
Popedom pos = po.next();
long temp = pos.getPopedomid();
if (temp == 10006) {
b = true;
break;
}
}
if (b == true) {
String roomid = request.getParameter("roomid");
List list = this.getDeptDao().findAllDepts();
Room room = this.getRoomDao().findById(Long.valueOf(roomid));
request.setAttribute("depts", list);
request.setAttribute("room", room);
return mapping.findForward("updateRoom");
} else {
request.setAttribute("error", "没有配置权限");
return mapping.findForward("error");
}
}
}
}
//更改页面
public ActionForward update(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RoomForm roomForm = (RoomForm)form;
HttpSession session = request.getSession(true);
boolean b = false;
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("error");
} else {
for (Iterator<Popedom> po = pope.iterator(); po.hasNext();) {
Popedom pos = po.next();
long temp = pos.getPopedomid();
if (temp == 10006) {
b = true;
break;
}
}
if (b == true) {
if(this.getRoomDao().updateRoom(roomForm, id)==true){
request.setAttribute("error", "更改成功");
}else{
request.setAttribute("error", "更改失败");
}
return mapping.findForward("roomListAction");
} else {
request.setAttribute("error", "没有配置权限");
return mapping.findForward("error");
}
}
}
}
//删除
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession(true);
boolean b = false;
String id = (String) session.getAttribute("empid");
if (id == null) {
return mapping.findForward("login");
} else {
List<Popedom> pope = (List<Popedom>)session.getAttribute("roomPope");
if (pope == null) {
request.setAttribute("error", "没有权限");
return mapping.findForward("error");
} else {
for (Iterator<Popedom> po =
没有合适的资源?快使用搜索试试~ 我知道了~
JIFANG.rar_java 权限_struts_权限
共161个文件
java:40个
class:40个
jsp:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 24 浏览量
2022-09-23
23:43:09
上传
评论
收藏 174KB RAR 举报
温馨提示
机房运营维护系统 java+oracle9i 使用struts 分用户权限 完成用户对机房信息的增删改查等功能
资源推荐
资源详情
资源评论
收起资源包目录
JIFANG.rar_java 权限_struts_权限 (161个子文件)
EmpDao.class 11KB
RManagerAction.class 10KB
ROManagerAction.class 10KB
RoomDao.class 8KB
DManagerAction.class 8KB
EManagerAction.class 8KB
DeptDao.class 7KB
MainAction.class 5KB
LManagerAction.class 4KB
RoleDao.class 4KB
Emp.class 4KB
LoginAction.class 4KB
LogDao.class 3KB
EmpForm.class 3KB
RoomForm.class 3KB
Dept.class 2KB
LogAfterAdvice.class 2KB
NewDeptForm.class 2KB
Role.class 2KB
Room.class 2KB
Popedom.class 2KB
DeptForm.class 2KB
EncondingFilter.class 2KB
LoginForm.class 2KB
Module.class 2KB
LogForm.class 2KB
Log.class 2KB
Pagination.class 1KB
JspFilter.class 1KB
IEmpDao.class 1KB
RoleForm.class 1KB
IRoomDao.class 1KB
PopedomDao.class 978B
IDeptDao.class 897B
ModuleDao.class 866B
IRoleDao.class 494B
ILogDao.class 308B
IPopedomDao.class 257B
IModuleDao.class 220B
IPagination.class 187B
.classpath 7KB
ROManagerAction.java 15KB
RManagerAction.java 14KB
DManagerAction.java 11KB
EManagerAction.java 11KB
EmpDao.java 11KB
RoomDao.java 7KB
DeptDao.java 7KB
MainAction.java 6KB
EmpForm.java 4KB
LManagerAction.java 4KB
RoomForm.java 4KB
Emp.java 4KB
LoginAction.java 3KB
RoleDao.java 3KB
NewDeptForm.java 3KB
LogAfterAdvice.java 2KB
Dept.java 2KB
LoginForm.java 2KB
LogDao.java 2KB
Role.java 2KB
Popedom.java 2KB
Room.java 2KB
Module.java 1KB
EncondingFilter.java 1KB
Log.java 1KB
DeptForm.java 1KB
IEmpDao.java 1KB
LogForm.java 968B
Pagination.java 945B
JspFilter.java 916B
IRoomDao.java 855B
IDeptDao.java 731B
RoleForm.java 725B
PopedomDao.java 445B
ModuleDao.java 374B
IRoleDao.java 363B
IPopedomDao.java 168B
IPagination.java 159B
IModuleDao.java 157B
ILogDao.java 154B
ts.js 2KB
de.js 1KB
de.js 1KB
de.js 1KB
updateEmp.jsp 4KB
empList.jsp 4KB
roomList.jsp 4KB
roleList.jsp 3KB
addEmp.jsp 3KB
deptList.jsp 3KB
main.jsp 3KB
queryResult.jsp 3KB
result.jsp 3KB
queryResult.jsp 3KB
cfgEmpRole.jsp 3KB
toUpdate.jsp 3KB
result.jsp 3KB
updateDept.jsp 2KB
toQuery.jsp 2KB
共 161 条
- 1
- 2
资源评论
JonSco
- 粉丝: 72
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功