?? syouhininputactionform.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 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;
/**
* MyEclipse Struts Creation date: 04-14-2006
*
* XDoclet definition:
*
* @struts.form name="syouhinInputActionForm"
*/
public class SyouhinInputActionForm extends ActionForm {
private String s_year;
private String yeshu;
private String dengji;
private String s_sp;
private String s_spname;
private String s_spnamel;
private String duix;
private String s_by;
private String s_fl;
private String s_qyyz;
private String s_qyfh;
private String s_ddbs;
// --------------------------------------------------------- Instance
// Variables
// --------------------------------------------------------- Methods
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
String name = request.getParameter("name");
ActionErrors errors = new ActionErrors();
/** 擛壥擭揑暥杮瀥?嬻丆漞弌??採帵 */
if (s_year == null || s_year.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.year.is.empty"));
return errors;
}/** 擛壥擭揑暥杮瀥撪強揢悢帤晄惀4埵丆漞弌??採帵 */
else if (s_year.length() != 4) {
errors.add("error", new ActionError(
"SyouhinInput.form.year.is.short4"));
return errors;
} else if (InputCheckUtil.BanJiao_Shuzi(s_year) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.year.is.notNum"));
return errors;
}/** 擛壥擭揑暥杮瀥撪強揢悢帤挻弌乮1930丆2010乯?槩錀?丆漞弌??採帵 */
else if (Integer.parseInt(s_year) <= 1930
|| Integer.parseInt(s_year) >= 2010) {
errors.add("error", new ActionError(
"SyouhinInput.form.year.is.over"));
return errors;
}
/** 擛壥梩彂嬫暘揑radiobutton枹??丆漞弌??採帵 */
if (yeshu == null || yeshu.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.youpiao_qufen.is.empty"));
return errors;
}
if (name.trim().equals("input")) {
/** 擛壥摍媺揑radiobutton枹??丆漞弌??採帵 */
if (dengji == null || dengji.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.grade.is.empty"));
return errors;
}
/** 擛壥徿昳僐乕僪揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_sp == null || s_sp.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftcode.is.empty"));
return errors;
}/** 擛壥徿昳僐乕僪揑暥杮瀥撪強揢悢帤挻弌5埵?丆漞弌??採帵 */
else if (s_sp.length() > 5) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftcode.is.numover5"));
return errors;
}/** 擛壥徿昳僐乕僪揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤?丆漞弌??採帵 */
else if (InputCheckUtil.BanJiao_Shuzi(s_sp) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftcode.is.notNum"));
return errors;
}
/** 擛壥徿昳柤揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_spname == null || s_spname.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftname.is.empty"));
return errors;
}/** 擛壥徿昳柤揑暥杮瀥撪強揢撪梕挻弌50埵?丆漞弌??採帵 */
else if (s_spname.length() > 50) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftname.is.numover50"));
return errors;
}
/** 擛壥徿昳柤棯徧揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_spnamel == null || s_spnamel.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftnamelue.is.empty"));
return errors;
}/** 擛壥徿昳柤棯徧揑暥杮瀥撪強揢撪梕挻弌15埵?丆漞弌??採帵 */
else if (s_spnamel.length() > 15) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftnamelue.is.numover15"));
return errors;
}
/** 擛壥帺戭攝憲揑radiobutton枹??丆漞弌??採帵 */
else if (duix == null || duix.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftsend.is.empty"));
return errors;
}
/** 擛壥昁梫擔悢揑暥杮瀥撪強揢悢帤挻弌3埵丆漞弌??採帵 */
else if (s_by.length() > 3) {
errors.add("error", new ActionError(
"SyouhinInput.form.mustday.is.numover3"));
return errors;
}/** 擛壥昁梫擔悢揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
else if (InputCheckUtil.BanJiao_Shuzi(s_by) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.mustday.is.notNum"));
return errors;
}
/** 擛壥暘椶揑暥杮瀥撪強揢撪梕挻弌15?丆漞弌??採帵 */
else if (s_fl.length() > 15) {
errors.add("error", new ActionError(
"SyouhinInput.form.fenkind.is.numover15"));
return errors;
}
/** 擛壥宊栺嬈幰僐乕僪揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_qyyz == null || s_qyyz.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.sendercode.is.empty"));
return errors;
}/** 擛壥宊栺嬈幰僐乕僪揑暥杮瀥撪強揢悢帤挻弌7埵?丆漞弌??採帵 */
else if (s_qyyz.length() > 7) {
errors.add("error", new ActionError(
"SyouhinInput.form.sendercode.is.numover7"));
return errors;
}/** 擛壥宊栺嬈幰僐乕僪揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
else if (InputCheckUtil.BanJiao_Shuzi(s_qyyz) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.sendercode.is.notNum"));
return errors;
}
/** 擛壥宊栺斣崋揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_qyfh == null || s_qyfh.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.sencode.is.empty"));
return errors;
}/** 擛壥宊栺斣崋揑暥杮瀥撪強揢悢帤挻弌10埵?丆漞弌??採帵 */
else if (s_qyfh.length() > 10) {
errors.add("error", new ActionError(
"SyouhinInput.form.sencode.is.numover10"));
return errors;
}/** 擛壥宊栺斣崋揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
else if (InputCheckUtil.BanJiao_Shuzi(s_qyfh) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.sencode.is.notallhalfnum"));
return errors;
}
/** 擛壥挷払杮悢揑暥杮瀥?嬻丆漞弌??採帵 */
else if (s_ddbs == null || s_ddbs.trim().equals("")) {
errors.add("error", new ActionError(
"SyouhinInput.form.benshu.is.empty"));
return errors;
}/** 擛壥挷払杮悢揑暥杮瀥撪強揢悢帤挻弌9埵?丆漞弌??採帵 */
else if (s_ddbs.length() > 9) {
errors.add("error", new ActionError(
"SyouhinInput.form.benshu.is.numover9"));
return errors;
}/** 擛壥挷払杮悢揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
else if (InputCheckUtil.BanJiao_Shuzi(s_ddbs) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.benshu.is.notNum"));
return errors;
}
}
if (name.trim().equals("select")) {
if (s_sp != null && !s_sp.trim().equals("")) {
/** 擛壥徿昳僐乕僪揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤?丆漞弌??採帵 */
if (InputCheckUtil.BanJiao_Shuzi(s_sp) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.giftcode.is.notNum"));
return errors;
}
}
if (s_by != null && !s_by.trim().equals("")) {
/** 擛壥昁梫擔悢揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
if (InputCheckUtil.BanJiao_Shuzi(s_by) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.mustday.is.notNum"));
return errors;
}
}
if (s_qyyz != null && !s_qyyz.trim().equals("")) {
/** 擛壥宊栺嬈幰僐乕僪揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
if (InputCheckUtil.BanJiao_Shuzi(s_qyyz) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.sendercode.is.notNum"));
return errors;
}
}
if (s_qyfh != null && !s_qyfh.trim().equals("")) {
/** 擛壥宊栺斣崋揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
if (InputCheckUtil.BanJiao_Shuzi(s_qyfh) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.sencode.is.notallhalfnum"));
return errors;
}
}
if (s_ddbs != null && !s_ddbs.trim().equals("")) {
/** 擛壥挷払杮悢揑暥杮瀥撪強揢悢帤晄惀敿妏悢帤丆漞弌??採帵 */
if (InputCheckUtil.BanJiao_Shuzi(s_ddbs) == false) {
errors.add("error", new ActionError(
"SyouhinInput.form.benshu.is.notNum"));
return errors;
}
}
}
return null;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
public String getDengji() {
return dengji;
}
public void setDengji(String dengji) {
this.dengji = dengji;
}
public String getDuix() {
return duix;
}
public void setDuix(String duix) {
this.duix = duix;
}
public String getS_by() {
return s_by;
}
public void setS_by(String s_by) {
this.s_by = s_by;
}
public String getS_ddbs() {
return s_ddbs;
}
public void setS_ddbs(String s_ddbs) {
this.s_ddbs = s_ddbs;
}
public String getS_fl() {
return s_fl;
}
public void setS_fl(String s_fl) {
this.s_fl = s_fl;
}
public String getS_qyfh() {
return s_qyfh;
}
public void setS_qyfh(String s_qyfh) {
this.s_qyfh = s_qyfh;
}
public String getS_qyyz() {
return s_qyyz;
}
public void setS_qyyz(String s_qyyz) {
this.s_qyyz = s_qyyz;
}
public String getS_sp() {
return s_sp;
}
public void setS_sp(String s_sp) {
this.s_sp = s_sp;
}
public String getS_spname() {
return s_spname;
}
public void setS_spname(String s_spname) {
this.s_spname = s_spname;
}
public String getS_spnamel() {
return s_spnamel;
}
public void setS_spnamel(String s_spnamel) {
this.s_spnamel = s_spnamel;
}
public String getS_year() {
return s_year;
}
public void setS_year(String s_year) {
this.s_year = s_year;
}
public String getYeshu() {
return yeshu;
}
public void setYeshu(String yeshu) {
this.yeshu = yeshu;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -