addstudentjyxxaction.java

来自「基于JAVA的学生就业信息网 实现对信息浏览 检索 审核 修改和删除」· Java 代码 · 共 133 行

JAVA
133
字号
/*
 * Created on 2006-7-27
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.ug.sztz.webview.structs.actions.student;

import java.net.InetAddress;

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.ug.sztz.domain.assistant.DateProcessor;
import org.ug.sztz.domain.oa.StudentBaseInfo;
import org.ug.sztz.webview.structs.forms.StudentForm;

/**
 * @author Skywalker
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class AddStudentJyxxAction extends BaseAction {

	/* (non-Javadoc)
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		StudentForm workform = (StudentForm)form;
		String xh = ((StudentBaseInfo)request.getSession().getAttribute("baseinfo")).getXh();
		workform.setXh(xh);
		if(workform.getLcnr()==null){
			workform.setLcnr("未知");
		}
		if(workform.getPqsj()==null){
			workform.setPqsj("未知");
		}
		if(workform.getJtfwcm()==null)
			workform.setJtfwcm("无");
		if(workform.getBdqx()==null)
			workform.setBdqx("未知");
		if(workform.getLjdlbz()==null)
			workform.setLjdlbz("未知");
		if(workform.getLhdwmc()==null)
			workform.setLhdwmc("未知");
		if(workform.getLhdwszd()==null)
			workform.setLhdwszd("未知");
		if(workform.getDwszd()==null)
			workform.setDwszd("未知");
		if(workform.getDwdz()==null)
			workform.setDwdz("未知");
		if(workform.getDwyzbm()==null)
			workform.setDwyzbm("未知");
		if(workform.getDwdh()==null)
			workform.setDwdh("未知");
		if(workform.getDwdzxx()==null)
			workform.setDwdzxx("未知");
		if(workform.getLsgzqd()==null)
			workform.setLsgzqd("未知");
		if(workform.getPqsj()==null)
			workform.setPqsj("未知");
		if(workform.getBdqx()==null)
			workform.setBdqx("未知");
		if(workform.getBjcg()==null)
			workform.setBjcg("否");
		if(workform.getBz1()==null)
			workform.setBz1("未知");
		if(workform.getBz2()==null)
			workform.setBz2("未知");
		if(workform.getBz3()==null)
			workform.setBz3("未知");
		if(workform.getDctjsj()==null)
			workform.setDctjsj("未知");
		
		if(workform.getBz4()==null)
			workform.setBz4("未知");
		if(workform.getBz5()==null)
			workform.setBz5("未知");
		if(workform.getBz6()==null)
			workform.setBz6("未知");
		if(workform.getNclfs()==null)
			workform.setNclfs("未知");
		if(workform.getQtsm()==null)
			workform.setQtsm("未知");
		if(workform.getGrdh()==null)
			workform.setGrdh("未知");
		if(workform.getQzff()==null)
			workform.setQzff("未知");
		if(workform.getMqzt()==null)
			workform.setMqzt("未知");
		if(workform.getDwcz()==null)
			workform.setDwcz("未知");
		if(workform.getDwlxr()==null)
			workform.setDwlxr("未知");
		if(workform.getJtfwcm()==null)
			workform.setJtfwcm("未知");
		if(workform.getDwjjlx()==null)
			workform.setDwjjlx("未知");
		if(workform.getJyzt()==null)
			workform.setJyzt("未知");
		if(workform.getDazjyzbm()==null)
			workform.setDazjyzbm("未知");
		
		workform.setXxbgsj(DateProcessor.getStringDate2());
		InetAddress myAddress = InetAddress.getLocalHost();
		String IP = myAddress.getHostAddress();
		workform.setXxbgip(IP);
		workform.setJlsd("不锁定");
		workform.setXysh("未知");
		workform.setXxsh("未知");
		workform.setFdysm("未知");
		workform.setXzstatus("新增");
		if(workform.getFdysm()==null)
			workform.setFdysm("未知");
		workform.setJlstatus("1");
		try {
			this.stuJYDao.updateStudentJYInfo(workform);
			return mapping.findForward("success");
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			request.setAttribute("reason","数据库操作失败!");
			return mapping.findForward("failure");
		}
	}
}

⌨️ 快捷键说明

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