第一范文网 - 专业文章范例文档资料分享平台

《HHL酒店管理系统》课程设计报告书V1.0 - 图文

来源:用户分享 时间:2025/5/16 7:48:23 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

else

MessageBox.Show(\可以添加!\); }

private void button2_Click(object sender, EventArgs e) {

if (this.textBox1.Text == \ || this.textBox2.Text == \||this.comboBox1.Text==\||this.comboBox2.Text==\) {

MessageBox.Show(\请把楼层、房间号、房价、房间类型填写完整!\); } else {

SqlConnection cnn = myCon.getCon();

string sql = \ + this.textBox1.Text + \ + this.comboBox2.SelectedItem.ToString() + \ + this.textBox2.Text + \ + this.comboBox1.SelectedItem.ToString() + \空房','','','无')\; cnn.Open();

SqlCommand cmd = new SqlCommand(sql, cnn); cmd.ExecuteNonQuery();

MessageBox.Show(\添加成功!\); } }

private void button3_Click(object sender, EventArgs e) {

if (this.textBox1.Text == \ || this.textBox2.Text == \ || this.comboBox1.Text == \ || this.comboBox2.Text == \) {

MessageBox.Show(\请把楼层、房间号、房价、房间类型填写完整!\); } else {

SqlConnection cnn = myCon.getCon();

string sql = \ + this.textBox2.Text + \ + this.comboBox1.SelectedItem.ToString() + \ + this.textBox1.Text + \; cnn.Open();

SqlCommand cmd = new SqlCommand(sql, cnn); cmd.ExecuteNonQuery();

MessageBox.Show(\修改成功!\); } }

- 37 -

private void button4_Click(object sender, EventArgs e) {

SqlConnection cnn = myCon.getCon();

string sql = \ + this.textBox1.Text + \; cnn.Open();

SqlCommand cmd = new SqlCommand(sql, cnn); string rt = (string)cmd.ExecuteScalar(); if (rt != \空房\)

MessageBox.Show(\该房间在使用中\); else if(rt==\空房\) {

string sql1 = \from Room where R_ID='\ + this.textBox1.Text + \;

SqlCommand cmd1 = new SqlCommand(sql1, cnn); cmd1.ExecuteNonQuery();

MessageBox.Show(\删除成功!\); } }

private void button5_Click(object sender, EventArgs e) {

SqlConnection con = myCon.getCon(); DataSet ds = null; con.Open();

StringBuilder sql = new StringBuilder();

sql.Append(\房间号,R_floor as 楼层,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注 from Room where R_ID='\ + this.textBox1.Text + \); SqlDataAdapter dapt = new SqlDataAdapter(sql.ToString(), con); ds = new DataSet(); dapt.Fill(ds, \);

dataGridView1.DataSource = ds.Tables[0]; }

private void FrmRoomInf_Load(object sender, EventArgs e) {

SqlConnection con = myCon.getCon(); DataSet ds = null; con.Open();

StringBuilder sql = new StringBuilder();

sql.Append(\房间号,R_floor as 楼层,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注 from Room\);

- 38 -

SqlDataAdapter dapt = new SqlDataAdapter(sql.ToString(), con); ds = new DataSet(); dapt.Fill(ds, \);

dataGridView1.DataSource = ds.Tables[0]; } 运行结果:

由右边的显示区可知道一楼总共有八间房,从101——108,现在想添加一间109房。

输入109房号后检测是否存在该房号

- 39 -

系统提示可以添加,确定价格和类型,之后点击“添加”

查询109是否添加到数据库

显示区有109房的添加成功的信息。

7.设计心得

黄健帮心得

HHL酒店管理系统对于我甚至我组员来说比较陌生,因为可能对酒店的业务流程不是很

熟悉,例如一间酒店有很多层,每一层有很多间套房,更大的酒店甚至会有几栋楼层,再如,房间的状态也是要有所考虑的,空房、住房中、维修中等等,因此,要先确定好需求,才可以把系统的功能确定下来。在数据库设计过程中,在约束建立时容易出现错误,这里要必须要理清表间关系。另外,我负责本系统的房间信息管理、房间类型管理、客户信息管理、换房管理等功能。其中房间信息管理,我主要对房间信息的添加、修改、删除和查询等功能进

- 40 -

《HHL酒店管理系统》课程设计报告书V1.0 - 图文.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c3hqtu1wbhp4i6jo0x0ha_10.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top