嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
《酒店管理系统》的用户包括管理员,财务部人员和前台人员,其中前台人员的权限最低,只能登录首页和办理入住,退宿,查看客户信息以及管理个人中心管理。财务部人员在前台的基础上增加财务管理模块的使用权限,管理员对整个系统有最高权限使用权限。
删除房间Ajax的源码
function user_del(obj, id) {layer.confirm('确认要删除吗??',function(index) {
$(obj).parents("tr").remove();
layer.msg('已删除!',1);
$.ajax({type : "post",
url : "/HotelManagement/RoomDelServlet",
dataType : "text",
data : {"roomid" : id},
})
},function(index) {layer.close(index)
layer.msg('已取消!',1);
});
}
Servlet部分
通过Servlet对数据库中的数据进行查询,并添加到List集合中,并将List集合转化为JSON数组,传给Ajax进行处理。
try {String sql2 = "select roomtype_price from t_roomtype where roomtype_typeName='" roomtype "'";
String sql3 = "select roomtype_bedNum from t_roomtype where roomtype_typeName='" roomtype "'";
ResultSet rs3 = DbInquire.inquire(sql2);
ResultSet rs4 = DbInquire.inquire(sql3);
//对rs结果集进行判断,并对其进行处理你
while (rs3.next()&&rs4.next()) {
System.out.println(sql2);
System.out.println(sql3);
RoomInfo roominfo1 = new RoomInfo();
roominfo1.setPrice(Integer.parseInt(rs3.getString("roomtype_price"))); roominfo1.setBednum(Integer.parseInt(rs4.getString("roomtype_bedNum")));
Pricels.add(roominfo1);
//将List集合转化为Json数组
Gson gson = new Gson();
json = gson.toJson(Pricels);
System.out.println("json=" json);
request.setAttribute("listprice", Pricels);}
} catch (SQLException e) {e.printStackTrace();}
//将Json数组传给前台Ajax进行处理
response.getWriter().print(json);