?? addstudentjyxxaction.java
字號:
/*
* 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.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("未知");
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");
}
}
}