?? gyousyainputactionform.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 + -