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

📄 firstkindaction.java

📁 人力资源管理系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.accphr.web.action;

import java.io.PrintWriter;

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

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.omg.CORBA.Request;

import com.accphr.biz.IFirstKindBiz;
import com.accphr.entity.FirstKind;
import com.accphr.page.PageResult;
import com.accphr.web.form.FirstKindForm;


/**
 * 客户化设置=》人力资源档案=》一级机构
 * 一级机构Action
 * @author Administrator
 *
 */
public class FirstKindAction extends DispatchAction {
	
	private IFirstKindBiz firstKindBiz=null;

	public void setFirstKindBiz(IFirstKindBiz firstKindBiz) {
		this.firstKindBiz = firstKindBiz;
	}
	
	
	//显示一级机构
	public ActionForward toList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {	
		FirstKindForm firstKindForm = (FirstKindForm) form;
		PageResult pageResult=firstKindForm.getPageResult();
//		if(pageResult.getPageSize()!=4){
//			pageResult.setPageSize(pageResult)
//		}
		this.firstKindBiz.setPageResult(null,pageResult);
		return mapping.findForward("tolist");
	}
	
	//到更新页面
	public ActionForward toUpdate(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		FirstKindForm firstKindForm = (FirstKindForm) form;
		FirstKind firstKind=firstKindForm.getFirstKind();
		firstKind=this.firstKindBiz.findById(firstKind.getFfkId());
		firstKindForm.setFirstKind(firstKind);
		return mapping.findForward("toupdate");
	}
	
	//到添加页面
	public ActionForward toAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		FirstKindForm firstKindForm = (FirstKindForm) form;
		return mapping.findForward("toadd");
	}
	
	//删除一级机构
	public ActionForward doDel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		FirstKindForm firstKindForm = (FirstKindForm) form;
		FirstKind firstKind=firstKindForm.getFirstKind();
		this.firstKindBiz.del(firstKind.getFfkId());
		
		PrintWriter out=response.getWriter();
		out.print("<script>alert('删除成功');location.href='firstKind.do?opfk=toList'</script>");
		return null;
	}
	
	//更新一级机构
	public ActionForward doUpdate(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		FirstKindForm firstKindForm = (FirstKindForm) form;
		//获取
		FirstKind firstKind=firstKindForm.getFirstKind();
		//更新
		this.firstKindBiz.update(firstKind);
		
		PrintWriter out=response.getWriter();
		out.print("<script>alert('更新成功');location.href='firstKind.do?opfk=toList'</script>");
		return null;
	}
	
	//添加一级机构
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		FirstKindForm firstKindForm = (FirstKindForm) form;
	
		FirstKind firstKind=firstKindForm.getFirstKind();
		this.firstKindBiz.add(firstKind);
		
		PrintWriter out=response.getWriter();
		out.print("<script>alert('添加成功');location.href='firstKind.do?opfk=toList'</script>");
		return null;
	}

	
}

⌨️ 快捷键说明

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