云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 《HHL酒店管理系统》课程设计报告书V1.0 - 图文

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/7 18:31:53

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 -

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

dataGridView1.DataSource = ds.Tables[0]; } else { MessageBox.Show(\该房间不能续房!!!\); } } catch (Exception ex) { MessageBox.Show(ex.Message, \操作数据库出错!\, MessageBoxButtons.OK, MessageBox

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com