基于JAVA的餐饮管理系统设计附程序代码 下载本文

基于JAVA的餐饮管理系统

return;

}

response.sendRedirect(\

判断餐桌的状态

if (tables != null) {

for (int i = 0; i < tables.size(); i++) {

%>

table

=

(DinnerTable)

tables.elementAt(i);%>

href=\

if (table.state == DinnerTable.STATE_EMPTY) {

%>

%>

<% }

服务员添加删除

public class Waiter extends DBRecord {

public int id;

47

基于JAVA的餐饮管理系统

public String name; public int sex; public Date birthday; public int typeID; public String workNum; public String memo; public String password;

public void setBirthday(int year, int month, int date) { }

public void updateInfo() throws HotelException {

//TODO update hotel information into database try { }

catch(InvalidDataException ide) { } try {

String sqlStr = \

\\\\

\\\

throw new HotelException(\数据不符合格式,保存失败\checkData();

Calendar c = Calendar.getInstance(); c.set(year, month, date, 0, 0, 0); birthday = c.getTime();

// 服务员类型: 迎宾, 点菜, 传菜

System.out.println(\

48

基于JAVA的餐饮管理系统

}

}

execCommand(sqlStr);

catch(ServiceUnavailableException sue) { }

throw new HotelException(\服务不可用,请联系管理员\

public void insert() throws HotelException {

//TODO update hotel information into database try { }

catch(InvalidDataException ide) { } try {

String sqlStr = \into Waiter(name, password, typeID, workNum, sex, birthday, throw new HotelException(\数据不符合格式,保存失败\checkData();

memo) values('\

}

catch(ServiceUnavailableException sue) { }

throw new HotelException(\服务不可用,请联系管理员\

name + \password + \typeID + \workNum + \sex + \

birthday.getTime() + \memo + \

System.out.println(\execCommand(sqlStr);

49

基于JAVA的餐饮管理系统

}

public void retrieveInfo() throws HotelException { }

public boolean checkPassword(String passwd) throws HotelException {

//TODO retrieve hotel information from database // write event log try { }

catch(ServiceUnavailableException sue) { }

catch(RecordNotFoundException rnfe) {

return false;

throw new HotelException(\服务不可用,请联系管理员\

retrieveData(\return password.equals(passwd);

//TODO retrieve hotel information from database // write event log try { }

catch(ServiceUnavailableException sue) { }

catch(RecordNotFoundException rnfe) { }

catch(InvalidDataException ide) { }

throw new HotelException(\请求的数据不符合格式,请联系管理员\

throw new HotelException(\请求的数据不存在,请联系管理员\

throw new HotelException(\服务不可用,请联系管理员\retrieveData(\

50





align=\

size=\

if ((i+1)%5 == 0) { %>