基于JSF开发的一个洒店管理系,具有中文

源代码在线查看: room.java

软件大小: 882 K
上传用户: As
关键词: JSF
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * @(#)Room.java	1.0 05/10/10
				 *
				 * Copyright 2005 HUST Hotel, Inc. All rights reserved.
				 */
				
				package net.husthotel.beans;
				
				import java.util.Date;
				
				/**
				 * 代表房间.
				 * @author icerain
				 * @version 1.0
				 */
				public class Room  {
					private String roomStyle; //房间类型
					private String roomPrice; //房间价格
					private String roomState; //房间状态
					private Date checkoutDate; //房屋退出时间
					private Date checkinDate ; //房屋入住时间
					private String roomNum; //房间号
					
					private boolean editable = false;
					private boolean deletable = false;
					
					public Room() {
						
					}
					
					/**
					 * 添加房间.
					 * @return a string 用于JSF导航;表示是否添加成功.
					 */
					public String addRoomAction() {
						/*
						 * Parameters:
						 *year - the year minus 1900.
						 *month - the month between 0-11.
						 *date - the day of the month between 1-31.
						 */
						checkoutDate = new Date(2000-1900,0,1); //默认值要在Mysql数据库中Date的范围内
						checkinDate = new Date(2000-1900,0,1);
						return new Administrator().addRoomAction(this);
					}
					
					/**
					 * 删除房间.
					 * @return a string 用于JSF导航;表示是否删除成功.
					 */
					public String deleteRoomAction() {
						if( new Administrator().deleteRoom(getRoomNum())) {
							return "aOperateSuc";
						}
						return "aOperateFail";
					}
					
					/**
					 * 修改房间信息.
					 * @return a string.
					 */
					public String modifyRoomInfoAction() {
						return new Administrator().modifyRoomInfo(this);
					}
					/*----------------------getter/setter 方法------------------------------*/
					public Date getCheckinDate() {
						return checkinDate;
					}
					public void setCheckinDate(Date checkinDate) {
						this.checkinDate = checkinDate;
					}
					public Date  getCheckoutDate() {
						return checkoutDate;
					}
					public void setCheckoutDate(Date checkoutDate) {
						this.checkoutDate = checkoutDate;
					}
					public String getRoomNum() {
						return roomNum;
					}
					public void setRoomNum(String roomNum) {
						this.roomNum = roomNum;
					}
					public String getRoomPrice() {
						return roomPrice;
					}
					public void setRoomPrice(String roomPrice) {
						this.roomPrice = roomPrice;
					}
					public String getRoomState() {
						return roomState;
					}
					public void setRoomState(String roomState) {
						this.roomState = roomState;
					}
					public String getRoomStyle() {
						return roomStyle;
					}
					public void setRoomStyle(String roomStyle) {
						this.roomStyle = roomStyle;
					}
					public boolean isEditable() {
						return editable;
					}
					public void setEditable(boolean editable) {
						this.editable = editable;
					}
				
					public boolean isDeletable() {
						return deletable;
					}
				
					public void setDeletable(boolean deletable) {
						//System.out.println("room:setDeletable" + deletable);
						this.deletable = deletable;
					}
					
				}
							

相关资源