⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deptsystemaction.java

📁 一个oa系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.oa.deptoffice.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.oa.db.DepartmentDAO;
import com.oa.db.DeptSystemDao;
import com.oa.deptoffice.form.DeptSystemForm;
import com.oa.page.PageBean;

/**
 * MyEclipse Struts Creation date: 08-25-2007
 * 
 * XDoclet definition:
 * 
 * @struts.action path="/deptSystem" name="deptSystemForm" input="/index.jsp"
 *                scope="request" validate="true"
 */
public class DeptSystemAction extends Action {
	/*
	 * Generated Methods
	 */
	private DeptSystemDao deptSystemDao;

	private DepartmentDAO deptDao;
	
	private PageBean pageBean;
	/**
	 * @return the pageBean
	 */
	public PageBean getPageBean() {
		return pageBean;
	}

	/**
	 * @param pageBean the pageBean to set
	 */
	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}

	/**
	 * @return the deptDao
	 */
	public DepartmentDAO getDeptDao() {
		return deptDao;
	}

	/**
	 * @param deptDao
	 *            the deptDao to set
	 */
	public void setDeptDao(DepartmentDAO deptDao) {
		this.deptDao = deptDao;
	}

	/**
	 * @return the deptSystemDao
	 */
	public DeptSystemDao getDeptSystemDao() {
		return deptSystemDao;
	}

	/**
	 * @param deptSystemDao
	 *            the deptSystemDao to set
	 */
	public void setDeptSystemDao(DeptSystemDao deptSystemDao) {
		this.deptSystemDao = deptSystemDao;
	}

	/**
	 * Method execute
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		DeptSystemForm deptSystemForm = (DeptSystemForm) form;// TODO
																// Auto-generated
																// method stub
		List list = (List) deptSystemDao.findAllSystem();
		if (list != null && list.size() != 0) {
			pageBean.setPageSize(50);
			pageBean.setTotalRecoder(list.size());
			String currentPage = request.getParameter("currentPage");
			int total = list.size();
			if (currentPage == null) {
				pageBean.setCurrentPage(1);
			} else {
				pageBean.setCurrentPage(Integer.valueOf(currentPage));
			}
			int start = pageBean.getStart() - 1;
			if((total-start)>50){
				request.setAttribute("allsystem", list.subList(start, start+50));
			}else{
				request.setAttribute("allsystem", list.subList(start, total));
			}
			request.setAttribute("pageBean", pageBean);
		}
		List deptlist = (List) deptDao.showAll();
		if (deptlist != null && deptlist.size() != 0) {
			request.setAttribute("alldept", deptlist);
		}
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -