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

📄 storeinform.java

📁 J2EE电子商务系统开发从入门到精通---基于Struts和Hibernate技术实现
💻 JAVA
字号:
/*
 * StoreInsertForm.java
 *
 * Created on 2006年5月21日, 下午9:31
 */

package form.store;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Administrator
 * @version
 */

public class StoreinForm extends org.apache.struts.action.ActionForm {
    private String name;
    private String roomId;
    private String productId;
    private String clientId;
    private String inYear, inMonth, inDay;
    private String remarks;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getInYear() {
        return inYear;
    }

    public void setInYear(String inYear) {
        this.inYear = inYear;
    }

    public String getInMonth() {
        return inMonth;
    }

    public void setInMonth(String inMonth) {
        this.inMonth = inMonth;
    }

    public String getInDay() {
        return inDay;
    }

    public void setInDay(String inDay) {
        this.inDay = inDay;
    }

    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("errors.storein.name.required"));
        }
        if (getRoomId() == null || getRoomId().equals("")) {
            errors.add("roomid", new ActionMessage("errors.storein.roomid.required"));
        }
        if (getProductId() == null || getProductId().equals("")) {
            errors.add("productid", new ActionMessage("errors.storein.productid.required"));
        }
        if (getClientId() == null || getClientId().equals("")) {
            errors.add("clientid", new ActionMessage("errors.storein.clientid.required"));
        }
        if (getInYear() == null || getInYear().equals("") ||
			getInMonth() == null || getInMonth().equals("") ||
			getInDay() == null || getInDay().equals("")) {
            errors.add("intime", new ActionMessage("errors.storein.intime.required"));
        }
        if (getRemarks() == null) {
            errors.add("remarks", new ActionMessage("errors.storein.remarks.required"));
        }
        return errors;
    }
}

⌨️ 快捷键说明

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