⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gyousyainputactionform.java

📁 用strutshibernate做的项目
💻 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.db.Gyousya;
import com.dut.logic.logic.InputCheckUtil;
import com.dut.logic.util.NumberUtil;
import com.dut.logic.util.StringUtil;

/** 
 * MyEclipse Struts
 * Creation date: 04-04-2006
 * 
 * XDoclet definition:
 * @struts.form name="gyousyaInputActionForm"
 */
public class GyousyaInputActionForm extends ActionForm {

	// --------------------------------------------------------- Instance Variables

	/** 契约业者NAME */
	private String qiYueZheName="";
	/** 契约业者ID */
	private String qiYueZheID="";
	/** 契约业者EMAIL */
	private String qiYueZheEmail="";
	/** 参数,用于判断按钮 */
	private String Mess="";
	/** 契约业者录入时间 */
	private String insert_data="";
	/** 契约业者更改时间表 */
	private String update_data="";
	
	// --------------------------------------------------------- Methods

	/** 
	 * Method validate
	 * 对用户输入的契约业者信息进行校验和数据封装,传递处理,参数进行调用
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 * @author 赵倩 04-04-2006
	 */
	public ActionErrors validate(
		ActionMapping mapping,
		HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		boolean flag=false;
		/**
		 * "契約業者情報登録確認"页的"登録"功能的chick out�
		 */
		/** 判断契约者Name是否為30字以内的半角全角文字,数据是否重复��*/
		if(Mess.equals("denglu")){
			if(qiYueZheID.equals("")){
				errors.add("error", new ActionError("GyousyaInput.jsp.ID.is.null"));
				request.setAttribute("focus", "qiYueZheID");
				return errors;
			}
			else{
				/** ���判断契約業者ID是否為数字,半角,指定桁 */
				flag=InputCheckUtil.BanShu(qiYueZheID,7);
				if(flag==false){
					errors.add("error", new ActionError("GyousyaInput.jsp.ID.is.NG"));
					request.setAttribute("focus", "qiYueZheID");
					return errors;
				}
				/** 数据是否重負��*/
				Gyousya gy=new Gyousya();
				flag=gy.JiansuoNG(qiYueZheID,0);
				if(flag==true){
					errors.add("error", new ActionError("GyousyaInput.jsp.ID.is.have"));
					request.setAttribute("focus", "qiYueZheID");
					return errors;
				}
				else{
				}
			}
			/** ���判断契約業者Name是否為30字以内の半角全角文字,数据是否重負 */
			if(qiYueZheName.equals("")){
				errors.add("error", new ActionError("GyousyaInput.jsp.Name.is.null"));
				request.setAttribute("focus", "qiYueZheName");
				return errors;
			}
			else{
				/** ���判断契約業者Name是否為30字以内の半角全角文字 ����*/
				flag=NumberUtil.lenNG(qiYueZheName,30);
				if(flag==false){
					errors.add("error", new ActionError("GyousyaInput.jsp.Name.is.NG"));
					request.setAttribute("focus", "qiYueZheName");
					return errors;
				}
			}
			/**���判断契約業者Email是否為60字以内の半角英数字,数据是否重負*/
			if(qiYueZheEmail.equals("")){
				errors.add("error", new ActionError("GyousyaInput.jsp.Email.is.null"));
				request.setAttribute("focus", "qiYueZheEmail");
				return errors;
			}
			else{
				/**判断契約業者Email是否為60字以内の半角英数字����*/
				flag=InputCheckUtil.EmailHangXiaBanYing(qiYueZheEmail,60);
				if(flag==true){
					flag=InputCheckUtil.EmailNG(qiYueZheEmail);
				}
				if(flag==false){
					errors.add("error", new ActionError("GyousyaInput.jsp.Email.is.NG"));
					request.setAttribute("focus", "qiYueZheEmail");
					return errors;
				}
			}
		}
		/**
		 * �契約業者情報登録確認の検索功能のchick out
		 */
		else if(Mess.equals("login")){
			boolean flagNG=true;
			/** ���判断契約業者ID是否為数字,半角,指定桁,数据是否重負 */
			if(qiYueZheID.equals("")){
			}
			else{
				/** ���判断契約業者ID是否為数字,半角,指定桁以下 �ȉ�*/
				flag=InputCheckUtil.BanShu(qiYueZheID,7);
				if(flag==false){
					errors.add("error", new ActionError("GyousyaInput.jsp.ID.is.NG"));
					request.setAttribute("focus", "qiYueZheID");
					return errors;
				}
				/** 判断契約業者ID数据是否重負 */
				else{
					Gyousya gy=new Gyousya();
					flagNG=gy.JiansuoNG(qiYueZheID,0);
					if(flagNG==false){
						errors.add("error", new ActionError("GyousyaInput.jsp.ID.isn't.have"));
						request.setAttribute("focus", "qiYueZheID");
						return errors;
					}
					else{
					}
				}
			}
			/** 判断契約業者Name是否為30字以内の半角全角文字,数据是否重負 ��*/
			if(qiYueZheName.equals("")){
			}
			else{
				/** ���判断契約業者Name是否為30字以内の半角全角文字 ����*/
				flag=NumberUtil.lenNG(qiYueZheName,30);
				if(flag==false){
					errors.add("error", new ActionError("GyousyaInput.jsp.Name.is.NG"));
					request.setAttribute("focus", "qiYueZheName");
					return errors;
				}
				/** ���判断契約業者ID数据是否重負 ��*/
				else{
					Gyousya gy=new Gyousya();
					flagNG=gy.JiansuoNG(qiYueZheName,1);
					if(flagNG==false){
						errors.add("error", new ActionError("GyousyaInput.jsp.Name.isn't.have"));
						request.setAttribute("focus", "qiYueZheID");
						return errors;
					}
					else{
					}
				}
			}
		}
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
	}

	/** 
	 * Returns the QiYueZheName.
	 * @return String
	 */
	public String getQiYueZheName() {
		return qiYueZheName;
	}

	/** 
	 * Set the QiYueZheName.
	 * @param QiYueZheName The QiYueZheName to set
	 */
	public void setQiYueZheName(String QiYueZheName) {		
		this.qiYueZheName=StringUtil.trans(QiYueZheName);	
	}

	/** 
	 * Returns the QiYueZheID.
	 * @return String
	 */
	public String getQiYueZheID() {
		return qiYueZheID;
	}

	/** 
	 * Set the QiYueZheID.
	 * @param QiYueZheID The QiYueZheID to set
	 */
	public void setQiYueZheID(String QiYueZheID) {
		this.qiYueZheID=StringUtil.trans(QiYueZheID);
	}

	/** 
	 * Returns the QiYueZheEmail.
	 * @return String
	 */
	public String getQiYueZheEmail() {
		return qiYueZheEmail;
	}

	/** 
	 * Set the QiYueZheEmail.
	 * @param QiYueZheEmail The QiYueZheEmail to set
	 */
	public void setQiYueZheEmail(String QiYueZheEmail) {
		this.qiYueZheEmail=StringUtil.trans(QiYueZheEmail);
	}

	public void setMess(String Mess) {
		this.Mess = Mess;
	}
	
	public String getMess() {
		return Mess;
	}
	
	public void setInsert_data(String insert_data) {
		this.insert_data = insert_data;
	}
	
	public void setUpdate_data(String update_data) {
		this.update_data = update_data;
	}
	
	public String getInsert_data(){
		return insert_data;
	}
	
	public String getUpdate_data(){
		return update_data;
	}
}

⌨️ 快捷键说明

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