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

📄 caigoudingdanform.java

📁 自己写的一个java购销系统
💻 JAVA
字号:
package com.yuanjin.mtgx.form;

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;

import com.yuanjin.mtgx.entity.CaiGouDingDan;
import com.yuanjin.mtgx.entity.GongYingShang;

public class CaiGouDingDanForm extends ActionForm {
	private CaiGouDingDan cgdd=new CaiGouDingDan();
	private String gysh;

	public String getGysh() {
		return gysh;
	}

	public void setGysh(String gysh) {
		this.gysh = gysh;
	}

	public CaiGouDingDan getCgdd() {
		return cgdd;
	}

	public void setCgdd(CaiGouDingDan cgdd) {
		this.cgdd = cgdd;
	}

	@Override
	public void reset(ActionMapping arg0, HttpServletRequest request) {
		// TODO Auto-generated method stub

		GongYingShang gys=(GongYingShang) request.getAttribute("gysForAddCaiGouDingDan");
		if(gys!=null){
			gysh=gys.getGysh();
			CaiGouDingDan caiGDD=new CaiGouDingDan();
			caiGDD.setMtpm(gys.getMtpz());
			caiGDD.setPzdj(gys.getJg());
			setCgdd(caiGDD);
		}
	}

	@Override
	public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {
		// TODO Auto-generated method stub
		ActionErrors errors=new ActionErrors();
		if(cgdd.getCgdbh()== null||cgdd.getCgdbh().length()==0){
			ActionMessage message=new ActionMessage("errors.cgdbh");
			errors.add("cgdbh",message);
		}
		if(cgdd.getCgsl()<=0){
			ActionMessage message=new ActionMessage("errors.cgsl");
			errors.add("cgsl",message);
		}
		return errors;
	}
	

}

⌨️ 快捷键说明

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