wt1201form.java

来自「一个完整的物流系统」· Java 代码 · 共 297 行

JAVA
297
字号

package jp.com.cost.wt.web.form;

import javax.servlet.http.HttpServletRequest;

import jp.com.cost.common.DataCheckor;

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

/*******************************************************************************
 * 
 * 类名.java
 * 	
 * [ 录属于: 委托管理 SW1201页面 ]
 * @version v1.0
 * @author 白银虎
 * @struts.form name="WT1201Form"
 * @extends org.apache.struts.action.ActionForm
 * 
 *
 ***************************************************************************** */
public class WT1201Form extends ActionForm {

	/**
	 * 序列化ID = -5709994246145842505L
	 */
	private static final long serialVersionUID = -5709994246145842505L;
	/** id property */
	private String id;
	private String sendperon;
	private String receperson;
	private String notifyperson;
	private String type;
	private double size;
	private double weight;
	private String receplace;
	private String deliplace;
	private double trafree;
	private double dealcost;
	private String transway;
	private String company;

	

	/**
	 * Method validate WT1201页面中的验证
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		
		ActionErrors errors = new ActionErrors();

		String trafree = request.getParameter("trafree");
		String dealcost = request.getParameter("dealcost");
		String size = request.getParameter("size");
		String weight = request.getParameter("weight");

		if (DataCheckor.isNull(sendperon)) {
			errors.add("sendperonError", new ActionMessage(
					"WT1201Form.sendperon"));
		}
		if (DataCheckor.isNull(receperson)) {
			errors.add("recepersonError", new ActionMessage(
					"WT1201Form.receperson"));
		}
		if (DataCheckor.isNull(notifyperson)) {
			errors.add("notifypersonError", new ActionMessage(
					"WT1201Form.notifyperson"));
		}
		if (DataCheckor.isNull(type)) {
			errors.add("typeError", new ActionMessage("WT1201Form.type"));
		}
		if (DataCheckor.isNull(size) || DataCheckor.isNotNumber(size)) {
			errors.add("sizeError", new ActionMessage("WT1201Form.size"));
		}
		if (DataCheckor.isNull(weight) || DataCheckor.isNotNumber(weight)) {
			errors.add("weightError",
					new ActionMessage("WT1201Form.weight"));
		}
		if (DataCheckor.isNull(receplace)) {
			errors.add("receplaceError", new ActionMessage(
					"WT1201Form.receplace"));
		}
		if (DataCheckor.isNull(deliplace)) {
			errors.add("deliplaceError", new ActionMessage(
					"WT1201Form.deliplace"));
		}

		if (DataCheckor.isNull(trafree) || DataCheckor.isNotNumber(trafree)) {
			errors.add("trafreeError", new ActionMessage("WT1201Form.trafree"));
		}
		if (DataCheckor.isNull(dealcost) || DataCheckor.isNotNumber(dealcost)) {
			errors.add("dealcostError",
					new ActionMessage("WT1201Form.dealcost"));
		}
		if (DataCheckor.isNull(company)) {
			errors.add("companyError", new ActionMessage("WT1201Form.company"));
		}
		if (DataCheckor.isNull(transway)) {
			errors.add("transwayError",
					new ActionMessage("WT1201Form.transway"));
		}
		return errors;
	}

	/**
	 * @return the id - 编号
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the sendperon
	 */
	public String getSendperon() {
		return sendperon;
	}

	/**
	 * @param sendperon the sendperon to set
	 */
	public void setSendperon(String sendperon) {
		this.sendperon = sendperon;
	}

	/**
	 * @return the receperson
	 */
	public String getReceperson() {
		return receperson;
	}

	/**
	 * @param receperson the receperson to set
	 */
	public void setReceperson(String receperson) {
		this.receperson = receperson;
	}

	/**
	 * @return the notifyperson
	 */
	public String getNotifyperson() {
		return notifyperson;
	}

	/**
	 * @param notifyperson the notifyperson to set
	 */
	public void setNotifyperson(String notifyperson) {
		this.notifyperson = notifyperson;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the size
	 */
	public double getSize() {
		return size;
	}

	/**
	 * @param size the size to set
	 */
	public void setSize(double size) {
		this.size = size;
	}

	/**
	 * @return the weight
	 */
	public double getWeight() {
		return weight;
	}

	/**
	 * @param weight the weight to set
	 */
	public void setWeight(double weight) {
		this.weight = weight;
	}

	/**
	 * @return the receplace
	 */
	public String getReceplace() {
		return receplace;
	}

	/**
	 * @param receplace the receplace to set
	 */
	public void setReceplace(String receplace) {
		this.receplace = receplace;
	}

	/**
	 * @return the deliplace
	 */
	public String getDeliplace() {
		return deliplace;
	}

	/**
	 * @param deliplace the deliplace to set
	 */
	public void setDeliplace(String deliplace) {
		this.deliplace = deliplace;
	}

	/**
	 * @return the trafree
	 */
	public double getTrafree() {
		return trafree;
	}

	/**
	 * @param trafree the trafree to set
	 */
	public void setTrafree(double trafree) {
		this.trafree = trafree;
	}

	/**
	 * @return the dealcost
	 */
	public double getDealcost() {
		return dealcost;
	}

	/**
	 * @param dealcost the dealcost to set
	 */
	public void setDealcost(double dealcost) {
		this.dealcost = dealcost;
	}

	/**
	 * @return the transway
	 */
	public String getTransway() {
		return transway;
	}

	/**
	 * @param transway the transway to set
	 */
	public void setTransway(String transway) {
		this.transway = transway;
	}

	/**
	 * @return the company
	 */
	public String getCompany() {
		return company;
	}

	/**
	 * @param company the company to set
	 */
	public void setCompany(String company) {
		this.company = company;
	}

	

}

⌨️ 快捷键说明

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