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

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

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

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

MessageBox.Show(\该房间不能续房!!!\); } }

catch (Exception ex) {

MessageBox.Show(ex.Message, \操作数据库出错!\, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }

finally {

con.Close(); } } 运行结果:

108房原定的退房时间是2012-6-22,现在想把退房时间再推后两天,即是2012-6-24号。

- 25 -

6.4结账退房功能的实现

代码如下:

if (txtfindID.Text == \) {

MessageBox.Show(\没有输入查询数据\); } else {

//退房前需要对房间的费用进行结算 SqlConnection con = myCon.getCon(); SqlCommand command = null;

string sql = \ + txtfindID.Text.Trim(); try {

command = new SqlCommand(sql, con); con.Open();

sql = \where R_ID=\ + txtfindID.Text.Trim();

command = new SqlCommand(sql, con); int num = (int)command.ExecuteScalar();

sql = \ + txtfindID.Text.Trim();

- 26 -

command = new SqlCommand(sql, con);

double Money = Convert.ToDouble(command.ExecuteScalar()); double sum = 0; sum = Money * num;

string str = Convert.ToString(sum);

MessageBox.Show(\需要支付的总金额为:\ + str);

}

catch (Exception ex) {

MessageBox.Show(ex.Message, \操作数据库出错!\, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }

finally {

con.Close(); }

if (txtfindID.Text == \) {

MessageBox.Show(\没有输入查询数据\); } else {

bool id =

BLL.CustomerBLL.BllUpdate(int.Parse(this.txtfindID.Text)); if (id) {

listView1.Items.Clear(); SqlDataReader dr =

BLL.CustomerBLL.BllSelectID(int.Parse(this.txtfindID.Text)); while (dr.Read()) {

ListViewItem lv = this.listView2.Items.Add(dr[0].ToString());

lv.SubItems.Add(dr[1].ToString()); lv.SubItems.Add(dr[2].ToString()); lv.SubItems.Add(dr[3].ToString()); lv.SubItems.Add(dr[4].ToString()); lv.SubItems.Add(dr[5].ToString()); lv.SubItems.Add(dr[6].ToString()); }

MessageBox.Show(\退房成功\); }

- 27 -

else {

MessageBox.Show(\退房失败\); } } } 运行结果:

查询要退房的信息,例如房号为108

- 28 -

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