资源简介
基于Qt5的酒店管理系统,包含预订、入住登记、退房结算、系统管理等一系列功能。

代码片段和文件信息
#include “data.h“
//**********************************************************
//追加消费页面
//**********************************************************
//确认追加消费
void MainWidget::on_addPrice_clicked()
{
addPrice();
}
//追加消费重置按钮
void MainWidget::on_clearAdd_clicked()
{
clearPrice();
}
//追加消费
void MainWidget::addPrice()
{
QString room = ui->room->text();
double goods = ui->goods->text().toDouble();
double damages = ui->damages->text().toDouble();
double phones = ui->phones->text().toDouble();
if(room == NULL)
{
QMessageBox::warning(this“Warnning““Can‘t be empty“QMessageBox::Yes);
}
else if(judgeRoomNumber(room) == false)
{
QMessageBox::warning(this“Warnning““RoomNumber is illegal“QMessageBox::Yes);
}
else
{
//修改链表
int i judge = 0;
for(i = 0; i < GuestList.size(); i++)
{
if(room == GuestList[i].RoomNumber)
{
judge = 1;
GuestList[i].GoodsPrice = goods + GuestList[i].GoodsPrice;
GuestList[i].DamagesPrice = damages + GuestList[i].DamagesPrice;
GuestList[i].PhonePrice = phones + GuestList[i].PhonePrice;
GuestList[i].AllPrice = GuestList[i].GoodsPrice +GuestList[i].PhonePrice
+ GuestList[i].DamagesPrice + GuestList[i].RoomPrice;
}
}
if(judge == 0)
{
QMessageBox::warning(this“Warnning““The room is empty“QMessageBox::Yes);
}
else
{
//修改文件
QString FileName = “guest.txt“;
QFile file(FileName);
if(!file.open(QIODevice::WriteOnly|QIODevice::Text))
{
QMessageBox::warning(this“Warnning““Open file failed“QMessageBox::Yes);
}
else
{
QTextStream in(&file);
for(i = 0; i < GuestList.size(); i++)
{
in << GuestList[i].name <<“\n“;
in << GuestList[i].sex <<“\n“;
in << GuestList[i].id <<“\n“;
in << GuestList[i].phone <<“\n“;
in << GuestList[i].RoomNumber <<“\n“;
in << GuestList[i].RoomType <<“\n“;
in << GuestList[i].RoomDiscount <<“\n“;
in << GuestList[i].CheckInDate <<“\n“;
in << GuestList[i].CheckOutDate <<“\n“;
in << GuestList[i].GoodsPrice <<“\n“;
in << GuestList[i].PhonePrice <<“\n“;
in << GuestList[i].DamagesPrice <<“\n“;
in << GuestList[i].RoomPrice <<“\n“;
in << GuestList[i].AllPrice <<“\n“;
}
file.close();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 154168 2015-06-09 16:05 HotelSystem\1.png
文件 3387 2015-06-12 00:37 HotelSystem\addConsume.cpp
文件 2239 2015-06-12 00:33 HotelSystem\backups.cpp
文件 4960 2015-06-11 23:32 HotelSystem\changeRoom.cpp
文件 6466 2015-06-12 00:37 HotelSystem\checkIn.cpp
文件 5646 2015-06-12 00:38 HotelSystem\checkOut.cpp
文件 595 2015-06-11 21:39 HotelSystem\choicePage.cpp
文件 1663 2015-06-11 22:59 HotelSystem\data.h
文件 4584 2015-06-11 21:42 HotelSystem\functions.cpp
文件 716 2015-06-12 08:35 HotelSystem\HotelSystem.pro
文件 18598 2015-06-12 09:11 HotelSystem\HotelSystem.pro.user
文件 332 2015-06-10 23:22 HotelSystem\image.qrc
文件 1768 2015-06-12 09:09 HotelSystem\leavingGuests.cpp
文件 1303 2015-06-11 21:39 HotelSystem\login.cpp
文件 15470 2015-06-09 17:57 HotelSystem\LOGO.png
文件 186 2015-06-11 21:40 HotelSystem\main.cpp
文件 368 2015-06-12 08:13 HotelSystem\main1.cpp
文件 4781 2015-06-12 08:32 HotelSystem\mainwidget.cpp
文件 3449 2015-06-12 09:06 HotelSystem\mainwidget.h
文件 137984 2015-06-12 08:59 HotelSystem\mainwidget.ui
文件 1349 2015-06-12 08:13 HotelSystem\mainwindow.cpp
文件 8121 2015-06-12 00:22 HotelSystem\order.cpp
文件 3701 2015-06-11 21:40 HotelSystem\query.cpp
文件 1747 2015-06-11 21:42 HotelSystem\roomSetting.cpp
文件 2627 2015-06-11 21:40 HotelSystem\systemSetting.cpp
文件 423 2015-06-12 09:09 HotelSystem\time.cpp
文件 3831 2015-06-10 22:27 HotelSystem\白色背景.png
文件 3836 2015-06-10 21:48 HotelSystem\纯色背景.png
文件 60158 2015-06-09 16:44 HotelSystem\登陆.png
文件 381073 2014-06-25 03:31 HotelSystem\功能选择.jpg
文件 35528 2014-06-25 03:39 HotelSystem\功能选择背景.jpg
............此处省略1个文件信息
相关资源
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- Mini6410 Qt4和Qtopia编程开发指南
- Qt实现Code39条形码
- qt_ffmpeg_mp4_export_and_import.zip
- QT5.5入门与项目实战
- Huffman Compress 霍夫曼编码 压缩 解压缩
- 基于QT的黑白棋游戏设计和实现
评论
共有 条评论