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

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

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/4 9:16:43

点击“退房”后

- 29 -

退房后,108房会自动变为空房

6.5营业查询功能的实现

代码如下:

string str = @\; string str1 = @\; string str2 = @\;

private void FrmHotelExpense_Load(object sender, EventArgs e) {

using (SqlConnection con = myCon.getCon()) {

con.Open();

StringBuilder sql = new StringBuilder();

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

- 30 -

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

}

dataGridView1.DataSource = ds.Tables[0];

}

private void butri_Click(object sender, EventArgs e) {

if (textBox1.Text == \) {

MessageBox.Show(\日期不能为空\); }

//日报表查询

else if (Regex.IsMatch(textBox1.Text.Trim(), str)) {

DataSet ds = new DataSet();

using (SqlConnection con = myCon.getCon()) {

con.Open();

DataSet dst = new DataSet();

string sql = string.Format(\R_ID as 房号,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注from Room where R_daoqitime='{0}'\, this.textBox1.Text); SqlDataAdapter dapt = new SqlDataAdapter(sql, con); dapt.Fill(dst, \);

dataGridView1.DataSource = dst.Tables[0]; float sun = 0;

for (int i = 0; i < dataGridView1.RowCount; i++) {

if (!dataGridView1.Rows[i].IsNewRow)

sun = sun + float.Parse(dataGridView1[1, i].Value.ToString()); }

label1.Text = \按日报表查询,总额为:\ + sun.ToString() + \元\;

con.Close();

- 31 -

} }

//月报表查询

else if (Regex.IsMatch(textBox1.Text.Trim(), str1)) {

DataSet ds = new DataSet();

using (SqlConnection con = myCon.getCon()) {

con.Open();

DataSet dst = new DataSet();

string time = this.textBox1.Text.Trim(); string year = time.Substring(0, 4); string month = time.Substring(5, 2);

string sql = \R_ID as 房号,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注from Room where year(R_daoqitime)='\ + year + \ + month + \;

SqlDataAdapter dapt = new SqlDataAdapter(sql, con); dapt.Fill(dst, \);

dataGridView1.DataSource = dst.Tables[0];

float sun = 0;

for (int i = 0; i < dataGridView1.RowCount; i++) {

if (!dataGridView1.Rows[i].IsNewRow)

sun = sun + float.Parse(dataGridView1[1, i].Value.ToString()); }

label1.Text = \按月报表查询,总额为:\ + sun.ToString() + \元\;

con.Close(); } }

//年报表查询

else if (Regex.IsMatch(textBox1.Text.Trim(), str2)) {

ds = new DataSet();

using (SqlConnection con = myCon.getCon()) {

con.Open();

DataSet dst = new DataSet();

- 32 -

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

共分享92篇相关文档

文档简介:

点击“退房”后 - 29 - 退房后,108房会自动变为空房 6.5营业查询功能的实现 代码如下: string str = @\; string str1 = @\; string str2 = @\; private void FrmHotelExpense_Load(object sender, EventArgs e) { using (SqlConnection con = myCon.getCon()) { con.Open();

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价: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