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

📄 clientinsertform.java

📁 企业管理信息系统 myeclipse+mysql+hibernate+struts
💻 JAVA
字号:
package com.emis.actionform.store;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class ClientInsertForm extends ActionForm {
	private String id;
    private String name;
    private String type;
    private String address;
    private String zip;
    private String phone;
    private String fax;
    private String remarks;
    
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getType() {
        return type;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public String getAddress() {
        return address;
    }
    
    public void setAddress(String address) {
        this.address = address;
    }
    
    public String getZip() {
        return zip;
    }
    
    public void setZip(String zip) {
        this.zip = zip;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public String getFax() {
        return fax;
    }
    
    public void setFax(String fax) {
        this.fax = fax;
    }
    
    public String getRemarks() {
        return remarks;
    }
    
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getName() == null || getName().equals("")) {
            errors.add("name", new ActionMessage("error.client.name.required"));
        }
        if (getId() == null || getId().equals("")) {
            errors.add("id", new ActionMessage("error.client.id.required"));
        }
        if (getZip() == null || getZip().equals("")) {
            errors.add("zip", new ActionMessage("error.client.zip.required"));
        }
        if (getType() == null || getType().equals("")) {
            errors.add("type", new ActionMessage("error.client.type.required"));
        }
        if (getAddress() == null || getAddress().equals("")) {
            errors.add("address", new ActionMessage("error.client.address.required"));
        }
        if (getPhone() == null || getAddress().equals("")) {
            errors.add("phone", new ActionMessage("error.client.phone.required"));
        }
        if (getFax() == null || getFax().equals("")) {
            errors.add("fax", new ActionMessage("error.client.fax.required"));
        }
        if (getRemarks() == null) {
            errors.add("remarks", new ActionMessage("error.client.remarks.required"));
        }
        return errors;
    }
}

⌨️ 快捷键说明

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