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

📄 addstaffform.java

📁 1 系统简介 1.1 系统名称:bugtrail 1.2 适用范围:大型或小型公司 1.3 用途:在项目周期内进行项目管理
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package bugtrail.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 bugtrail.basic.Staff;
import bugtrail.util.CharsetProcess;

/** 
 * MyEclipse Struts
 * Creation date: 12-18-2006
 * 
 * XDoclet definition:
 * @struts.form name="AddStaffForm"
 */
public class AddStaffForm extends ActionForm {
	/*
	 * Generated fields
	 */
    private Staff staff = new Staff();
	
	/** email property */
	private String email;

	/** department property */
	private String department;

	/** name property */
	private String name;

	/** role property */
	private String role;

	/** password property */
	private String password;

	private String address;
	
	private String phone;
	
	private String remark;
	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	@SuppressWarnings("deprecation")
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(getEmail().length()<1)
			errors.add("email",new ActionError("email.error"));
		if(getPassword().length()<1)
			errors.add("password", new ActionError("password.null"));
		if(getName().length()<1)
			errors.add("name", new ActionError("name.null"));
		if(getPhone().length()<0||!getPhone().matches("\\d+"))
			errors.add("phone", new ActionError("phone.error"));
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.staff = new Staff();
	}

	/** 
	 * Returns the email.
	 * @return String
	 */
	public String getEmail() {
		return email;
	}

	/** 
	 * Set the email.
	 * @param email The email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/** 
	 * Returns the department.
	 * @return int
	 */
	public String getDepartment() {
		return department;
	}

	/** 
	 * Set the department.
	 * @param department The department to set
	 */
	public void setDepartment(String department) {
		this.department = department;
	}

	/** 
	 * Returns the name.
	 * @return String
	 */
	public String getName() {
		return name;
	}

	/** 
	 * Set the name.
	 * @param name The name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/** 
	 * Returns the role.
	 * @return int
	 */
	public String getRole() {
		return role;
	}

	/** 
	 * Set the role.
	 * @param role The role to set
	 */
	public void setRole(String role) {
		this.role = role;
	}

	/** 
	 * Returns the password.
	 * @return String
	 */
	public String getPassword() {
		return password;
	}

	/** 
	 * Set the password.
	 * @param password The password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public Staff getStaff(){
		staff.addStaffInit(password,name, email,
				Integer.parseInt(role), Integer.parseInt(department),
				address,Integer.parseInt(phone),remark);
		return staff;
	}
}

⌨️ 快捷键说明

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