?? kensyoupdateactionform.java
字號:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xsl
package com.dut.struts.form;
import java.sql.Date;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.dut.logic.logic.InputCheckUtil;
import com.dut.logic.util.NumberUtil;
/**
* MyEclipse Struts Creation date: 04-11-2006
*
* XDoclet definition:
*
* @struts.form name="kensyoUpdateActionForm"
*/
public class KensyoUpdateActionForm extends ActionForm {
private String nen_H;
private String hagaki_id_H;
private String toukyu_id_H;
// --------------------------------------------------------- Instance
// Variables
// --------------------------------------------------------- Methods
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
Date sz_time = null;
Date sk_time = null;
int lastnumber = 0;
String sz = "";
String L_num = "";
String sk = "";
if (request.getParameter("name") != null) {
String name = request.getParameter("name");
System.out.println("name======>" + name);
/** **********判斷點擊的是[更新]按鈕********** */
if (name.equals("gengxin")) {
/** *******************判斷下桁數長度不為1 或者 為空************************* */
if ((request.getParameter("lastnumber")).length() != 1
|| request.getParameter("lastnumber") == null) {
System.out.println("name1122======>" + name);
errors.add("message", new ActionError("lastnumber_empty"));
return errors;
}
if (request.getParameter("lastnumber") != null) {
L_num = request.getParameter("lastnumber");
boolean b_lnum = NumberUtil.isnotNum(L_num);// 判斷半角數字
/** ****************如果不是半角數字************** */
if (b_lnum == true) {
errors.add("message", new ActionError("e_tlastnumber"));
return errors;
}
lastnumber = Integer.parseInt(L_num);
}
/** *******************如果開始日付為空***************************** */
if (request.getParameter("sz_time") == null
|| request.getParameter("sz_time").equals("")) {
errors.add("message", new ActionError("szyear_empty"));
return errors;
}
/** *********************如果結束日付為空*********************** */
if (request.getParameter("sz_time") != null
&& request.getParameter("sz_time").length() != 0
&& request.getParameter("sz_time").equals("") == false) {
sz = (String) request.getParameter("sz_time");
sk = request.getParameter("h_sk");
sk_time = InputCheckUtil.Turn_Date(sk);
boolean b_sz = InputCheckUtil.isnotDateformat(sz);// 判斷結束日付的格式
if (b_sz == true)// 如果格式不正確
{
errors.add("message", new ActionError("e_sz_year"));
return errors;
}
sz_time = InputCheckUtil.Turn_Date(sz);
boolean b_wen = sz_time.after(sk_time);// 判斷時間先后
/** ****************如果開始日付在結束日付之后**************** */
if (b_wen == false) {
errors.add("message", new ActionError("when"));
return errors;
}
}
}// update if
} // zui wai if
// TODO Auto-generated method stub
return errors;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
public String getSubmit_button() {
return submit_button;
}
public void setSubmit_button(String submit_button) {
this.submit_button = submit_button;
}
public String getHagaki_id_H() {
return hagaki_id_H;
}
public void setHagaki_id_H(String hagaki_id_H) {
this.hagaki_id_H = hagaki_id_H;
}
public String getNen_H() {
return nen_H;
}
public void setNen_H(String nen_H) {
this.nen_H = nen_H;
}
public String getToukyu_id_H() {
return toukyu_id_H;
}
public void setToukyu_id_H(String toukyu_id_H) {
this.toukyu_id_H = toukyu_id_H;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -