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

2025/5/10 13:15:40

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文档下载到电脑
搜索更多关于: 《HHL酒店管理系统》课程设计报告书V1.0 - 图文 的文档
相关推荐
相关阅读
× 快捷下载通道(下载后可以自由复制和排版)

开通会员免费下载

开通会员后百万份文档资料免费自由复制和下载,是您最优的选择,赶快来试试吧!

单篇下载:10元 点击下载

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219