ResumeAction.java~23~
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:8k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.xlchemical.struts.Action;
- import org.apache.struts.actions.DispatchAction;
- import org.apache.struts.action.ActionForward;
- import javax.servlet.http.HttpServletRequest;
- import org.apache.struts.action.ActionMapping;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.ActionForm;
- import com.chinacannel.xlchemical.struts.ActionForm.ResumeActionForm;
- import com.chinacannel.xlchemical.service.ResumeService;
- import com.chinacannel.entity.Resume;
- import com.chinacannel.entity.Jobs;
- import com.chinacannel.xlchemical.service.JobsService;
- import java.util.Date;
- import com.chinacannel.common.PageInfo;
- import com.chinacannel.entity.Menu;
- import java.util.List;
- import com.chinacannel.xlchemical.service.MenuService;
- public class ResumeAction extends DispatchAction {
- private ResumeService rs = new ResumeService();
- private MenuService ms = new MenuService();
- //添加应聘信息
- public ActionForward AddResume(ActionMapping actionMapping,
- ActionForm actionForm,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse) {
- ResumeActionForm raf = (ResumeActionForm)actionForm;
- JobsService js = new JobsService();
- Resume resume = new Resume();
- Jobs jobs = new Jobs();
- Long jobID = new Long(0);
- String Language = "CN";
- try {
- if (servletRequest.getSession().getAttribute("Language") != null) {
- Language = servletRequest.getSession().getAttribute("Language").
- toString();
- }
- jobID = new Long(servletRequest.getParameter("jobID"));
- rs.beginTran();
- jobs = js.GetJobsById(jobID);
- resume.setJobs(jobs);
- resume.setRes_Address(raf.getAddress());
- resume.setRes_Brithday(raf.getYear() + "-" + raf.getMonth() + "-" +
- raf.getDay());
- resume.setRes_Education(raf.getEducation());
- resume.setRes_Email(raf.getEmail());
- resume.setRes_Experience(raf.getExperience());
- resume.setRes_Graduate(raf.getGraduate());
- resume.setRes_Introduce(raf.getIntroduce());
- resume.setRes_Marriage(raf.getMarriage());
- resume.setRes_Name(raf.getName());
- resume.setRes_Nativeplace(raf.getNativeplace());
- resume.setRes_Polity(raf.getPolity());
- resume.setRes_PostCode(raf.getPostCode());
- resume.setRes_Power(raf.getPower());
- resume.setRes_Sex(raf.getSex());
- resume.setRes_Specialty(raf.getSpecialty());
- resume.setRes_Tel(raf.getTel());
- resume.setRes_Time(new Date());
- rs.AddResume(resume);
- rs.commit();
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- try {
- rs.rollback();
- } catch (Exception ex2) {
- log.error(ex2.getMessage(), ex2);
- }
- }
- String Message = "";
- if (Language.equals("CN")) {
- Message = "提交成功,请等待回复";
- }else{
- Message = "To succeed, please wait for return";
- }
- servletRequest.setAttribute("Message","提交成功,请等待回复");
- servletRequest.setAttribute
- ("Url", "/Index.do?todo=OpenJobs&fMenuID=" +
- servletRequest.getParameter("fMenuID"));
- servletRequest.setAttribute("resume", resume);
- return actionMapping.findForward("AddResume");
- }
- //打开招聘页
- public ActionForward OpenResume(ActionMapping actionMapping,
- ActionForm actionForm,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse) {
- JobsService js = new JobsService();
- Long jobID = new Long(0);
- Jobs job = null;
- String Language = "CN";
- try {
- if (servletRequest.getSession().getAttribute("Language") != null) {
- Language = servletRequest.getSession().getAttribute("Language").
- toString();
- }
- js.beginTran();
- jobID = new Long(servletRequest.getParameter("jobID"));
- job = js.GetJobsById(jobID);
- LeftMenu(Language,servletRequest);
- js.commit();
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- try {
- js.rollback();
- } catch (Exception ex2) {
- log.error(ex2.getMessage(), ex2);
- }
- }
- servletRequest.setAttribute("jobs", job);
- return actionMapping.findForward("OpenResume");
- }
- private void LeftMenu(String Language, HttpServletRequest servletRequest) {
- List menuList = null;
- Menu fMenu = null;
- Long fMenuID = new Long(0);
- if (servletRequest.getParameter("fMenuID") != null) {
- fMenuID = new Long(servletRequest.getParameter("fMenuID"));
- }
- fMenu = ms.GetMenuById(fMenuID);
- menuList = ms.GetMenuBySuperior(fMenuID, Language);
- servletRequest.setAttribute("menu", fMenu);
- servletRequest.setAttribute("menuList", menuList);
- }
- //打开后台应聘列表页
- public ActionForward OpenResumeList(ActionMapping actionMapping,
- ActionForm actionForm,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse) {
- PageInfo pageInfo = null;
- int pageNo = 0;
- try {
- pageNo = Integer.parseInt(servletRequest.getParameter("pageNo"));
- } catch (Exception ex1) {}
- try {
- rs.beginTran();
- pageInfo = rs.getPageInfo(pageNo);
- rs.commit();
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- try {
- rs.rollback();
- } catch (Exception ex2) {
- log.error(ex2.getMessage(), ex2);
- }
- }
- servletRequest.setAttribute("pageInfo", pageInfo);
- return actionMapping.findForward("OpenResumeList");
- }
- //打开后台应聘者详细信息页
- public ActionForward OpenResumeInfo(ActionMapping actionMapping,
- ActionForm actionForm,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse) {
- Long resID = new Long(0);
- Resume resume = null;
- try {
- resID = new Long(servletRequest.getParameter("resID"));
- rs.beginTran();
- resume = rs.GetResumeById(resID);
- rs.commit();
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- try {
- rs.rollback();
- } catch (Exception ex2) {
- log.error(ex2.getMessage(), ex2);
- }
- }
- servletRequest.setAttribute("resume", resume);
- return actionMapping.findForward("OpenResumeInfo");
- }
- public ActionForward DeleteResume(ActionMapping actionMapping,
- ActionForm actionForm,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse) {
- boolean b = false;
- String Message = "";
- try {
- rs.beginTran();
- Resume res = rs.GetResumeById(new Long(servletRequest.getParameter(
- "resID")));
- b = rs.DeleteResume(res);
- Message = "删除成功,请返回!";
- rs.commit();
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- try {
- rs.rollback();
- } catch (Exception ex2) {
- log.error(ex2.getMessage(), ex2);
- }
- }
- if (b == false) {
- Message = "删除失败,请返回!";
- }
- servletRequest.setAttribute("Message", Message);
- servletRequest.setAttribute("Url",
- "/Manage/Resume.do?todo=OpenResumeList");
- return actionMapping.findForward("DeleteResume");
- }
- }