数据库课程设计——宾馆客房管理内容摘要:

rId)) { (删除成功 , 提示 , )。 ()。 ()。 } else { (删除失败 , 提示 , )。 } } else { (用户密码输入错误 , 错误 , , )。 } 20 } } else { (用户数为 1,不可以再删除 , 警告 , , )。 } } (3)、房间管理模块: 房间类型操作类: ;房间类型操作类完成各种对房间类型的创建和维护的操作,例如增加删除等等。 /// summary /// 增加新房屋类型信息 /// /summary public void RoomType_Add(string typename, int area, int bednum, float price, int telephone, int tv, int toilet, int aircondition) { = insert into RoomType values( + 39。 + typename + 39。 , + area + , + bednum + , + price + , + aircondition + , + telephone + , + tv + , + toilet + )。 =。 try { ()。 ()。 } catch ( E) { 21 (())。 } finally { ()。 } } /// summary /// 删除房屋类型信息 /// /summary public void Room_Delete(string roomID) { = delete from Room where RoomID= + roomID。 =。 try { ()。 ()。 } catch ( E) { (())。 } finally { ()。 } } /// summary 22 /// 更新房屋类型信息 /// /summary public bool Room_Modify(string typename, int area, int bednum, float price, int telephone, int tv, int toilet, int aircondition) { = update RoomType set Area= + area + , + BedNum= + bednum + , + Price= + price + , + Toilet= + toilet + , + AirCondition= + aircondition + , + Television= + tv + , + Phone= + telephone + where RoomTypeName= + 39。 + typename + 39。 =。 try { ()。 ()。 return true。 } catch ( E) { (())。 return false。 } finally { ()。 } } /// summary /// 得到房屋类型名称 /// /summary 23 public DataTable GetRoomType() { = select RoomTypeName from RoomType。 =。 try { ()。 SqlDataAdapter Adapter = new SqlDataAdapter()。 DataSet ds = new DataSet()。 (ds)。 ()。 return [0]。 } catch (SqlException sqlEx) { throw sqlEx。 } } 房间类型管理: 房间类型管理窗体如图 5 图 6 详细代码实现: /// summary /// 读取房屋类型信息 24 /// /summary private void UpdateListView() { ()。 ()。 = select * from RoomType。 =。 try { if ( == ) ()。 = ()。 while (()) { ListViewItem li = new ListViewItem()。 ()。 [0].Text = sqlDataReader1[RoomTypeName].ToString()。 (sqlDataReader1[Area].ToString())。 (sqlDataReader1[BedNum].ToString())。 (sqlDataReader1[Price].ToString())。 if ((sqlDataReader1[AirCondition]) == true) (是 )。 else (否 )。 if ((sqlDataReader1[Phone]) == true) (是 )。 else (否 )。 if ((sqlDataReader1[Television]) == true) 25 (是 )。 else (否 )。 if ((sqlDataReader1[Toilet]) == true) (是 )。 else (否 )。 (li)。 } } catch ( E) { (())。 } finally { ()。 ()。 } if ( == 0) { (没有记录存在 , 没有记录 , , )。 } } /// summary /// 查找房屋类型信息 /// /summary private void button1_Click(object sender, EventArgs e) 26 { for (int i = 0。 i。 i++) { if ([i].SubItems[0].Text == ) { [i].Selected = true。 return。 } } (没有找到该记录 , 没有找到 )。 } /// summary /// 写入新房屋类型信息 /// /summary private void button4_Click(object sender, EventArgs e) { if (CheckInfor()) { string typename =。 int area = ()。 float price = ()。 int bednum = ()。 int tv = ()。 int telephone = ()。 int aircondition = ()。 int toilet = ()。 if (add) { roomtypeManage = new RoomTypeManage()。 (typename, area, 27 bednum, price, telephone, tv, toilet, aircondition)。 (添加信息成功 )。 ()。 } else {。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。