/*
 * Created on 2004/04/21
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package shop;

import fw.FacesUtils;

/**
 * @author miya
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class User {

	private String userId;
	private String password;
	private String name;

	
	public String doLogin(){
		//hoge/hogeのみログインOKとします。
		if(userId.equals("hoge") && password.equals("hoge")){
			name = "ほげ";
			return "ok";
		}else{
			FacesUtils.addGlobalMessage("shop.invalid.user");
			return "ng";
		}
	}


	

	/**
	 * @return Returns the password.
	 */
	public String getPassword() {
		return password;
	}
	/**
	 * @param password The password to set.
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	/**
	 * @return Returns the userId.
	 */
	public String getUserId() {
		return userId;
	}
	/**
	 * @param userId The userId to set.
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}
	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name The name to set.
	 */
	public void setName(String name) {
		this.name = name;
	}
}
