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

📄 workcoachaction.java

📁 仿招聘网站 SSH框架 ajax功能
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.chinahr.web.struts.action;

import java.util.ArrayList;
import java.util.List;

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 com.chinahr.biz.WorkcoachBiz;
import com.chinahr.pojo.SysVocGui;
import com.chinahr.pojo.SysVocational;
import com.chinahr.web.struts.form.WorkcoachForm;

/** 
 * MyEclipse Struts
 * Creation date: 10-28-2008
 * 
 * XDoclet definition:
 * @struts.action scope="request" validate="true"
 */
public class WorkcoachAction extends DispatchAction {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	
	WorkcoachBiz workcoachBiz;
	public ActionForward searchWork(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		this.workcoachBiz.searchWork(workcoachForm.getPageResult());
		return mapping.findForward("show");
	}
	
	public ActionForward toEdit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		String sid=(String) request.getParameter("id");
		Integer id=new Integer(sid);
		SysVocational sysvocational=this.workcoachBiz.getByid(id);
		workcoachForm.setSysvocational(sysvocational);
		List list=this.workcoachBiz.getList();
		request.setAttribute("list", list);
		return mapping.findForward("toedit");
	}
	
	public ActionForward doEdit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			this.workcoachBiz.doUpdate(workcoachForm.getSysvocational());
			request.setAttribute("ok", "ok");
			List list=this.workcoachBiz.getList();
			request.setAttribute("list", list);
			return mapping.findForward("toedit");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	public ActionForward doDelete(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			String sid=(String) request.getParameter("id");
			Integer id=new Integer(sid);
			SysVocational sysvocational=this.workcoachBiz.getByid(id);
			this.workcoachBiz.doDelete(sysvocational);
			//重新加载主页面(刷新)
			this.workcoachBiz.searchWork(workcoachForm.getPageResult());
			return mapping.findForward("show");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	
	public ActionForward doBigDelete(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			String sid=(String) request.getParameter("id");
			Integer id=new Integer(sid);
			SysVocGui sysvocgui=this.workcoachBiz.getBigByid(id);
			this.workcoachBiz.doBigDelete(sysvocgui);
			//重新加载主页面(刷新)
			this.workcoachBiz.bigSearch(workcoachForm.getPageResult());
			return mapping.findForward("bigshow");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	public ActionForward toAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		List list=this.workcoachBiz.getList();
		request.setAttribute("list", list);
		return mapping.findForward("add");
	}
	
	public ActionForward toBigAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		List list=this.workcoachBiz.getListBig();
		request.setAttribute("list", list);
		return mapping.findForward("bigadd");
	}
	
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			this.workcoachBiz.doSave(workcoachForm.getSysvocational());
			List list=new ArrayList();
			list=this.workcoachBiz.getList();
			request.setAttribute("list", list);
			request.setAttribute("ok", "ok");
			return mapping.findForward("add");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	public ActionForward doBigAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			this.workcoachBiz.doBigSave(workcoachForm.getSysvocgui());
			List list=new ArrayList();
			list=this.workcoachBiz.getListBig();
			request.setAttribute("list", list);
			request.setAttribute("ok", "ok");
			return mapping.findForward("bigadd");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	public ActionForward bigSearch(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		this.workcoachBiz.bigSearch(workcoachForm.getPageResult());
		return mapping.findForward("bigshow");
	}
	
	public ActionForward toBigEdit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		String sid=(String) request.getParameter("id");
		Integer id=new Integer(sid);
		SysVocGui sysvocgui=this.workcoachBiz.getBigByid(id);
		workcoachForm.setSysvocgui(sysvocgui);
		return mapping.findForward("bigedit");
	}
	
	public ActionForward doBigEdit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		WorkcoachForm workcoachForm=(WorkcoachForm) form;
		try{
			this.workcoachBiz.doBigUpdate(workcoachForm.getSysvocgui());
			request.setAttribute("ok", "ok");
			return mapping.findForward("bigedit");
		}catch(Exception ce){
			return mapping.findForward("error");
		}
	}
	
	public WorkcoachBiz getWorkcoachBiz() {
		return workcoachBiz;
	}
	public void setWorkcoachBiz(WorkcoachBiz workcoachBiz) {
		this.workcoachBiz = workcoachBiz;
	}
}

⌨️ 快捷键说明

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