酒店管理系统基于Qt Creator5)


基于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         <<“
“;
                    in << GuestList[i].sex          <<“
“;
                    in << GuestList[i].id           <<“
“;
                    in << GuestList[i].phone        <<“
“;
                    in << GuestList[i].RoomNumber   <<“
“;
                    in << GuestList[i].RoomType     <<“
“;
                    in << GuestList[i].RoomDiscount <<“
“;
                    in << GuestList[i].CheckInDate  <<“
“;
                    in << GuestList[i].CheckOutDate <<“
“;
                    in << GuestList[i].GoodsPrice   <<“
“;
                    in << GuestList[i].PhonePrice   <<“
“;
                    in << GuestList[i].DamagesPrice <<“
“;
                    in << GuestList[i].RoomPrice    <<“
“;
                    in << GuestList[i].AllPrice     <<“
“;
                }
                file.close();
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件      154168  2015-06-09 16:05  HotelSystem1.png
     文件        3387  2015-06-12 00:37  HotelSystemaddConsume.cpp
     文件        2239  2015-06-12 00:33  HotelSystemackups.cpp
     文件        4960  2015-06-11 23:32  HotelSystemchangeRoom.cpp
     文件        6466  2015-06-12 00:37  HotelSystemcheckIn.cpp
     文件        5646  2015-06-12 00:38  HotelSystemcheckOut.cpp
     文件         595  2015-06-11 21:39  HotelSystemchoicePage.cpp
     文件        1663  2015-06-11 22:59  HotelSystemdata.h
     文件        4584  2015-06-11 21:42  HotelSystemfunctions.cpp
     文件         716  2015-06-12 08:35  HotelSystemHotelSystem.pro
     文件       18598  2015-06-12 09:11  HotelSystemHotelSystem.pro.user
     文件         332  2015-06-10 23:22  HotelSystemimage.qrc
     文件        1768  2015-06-12 09:09  HotelSystemleavingGuests.cpp
     文件        1303  2015-06-11 21:39  HotelSystemlogin.cpp
     文件       15470  2015-06-09 17:57  HotelSystemLOGO.png
     文件         186  2015-06-11 21:40  HotelSystemmain.cpp
     文件         368  2015-06-12 08:13  HotelSystemmain1.cpp
     文件        4781  2015-06-12 08:32  HotelSystemmainwidget.cpp
     文件        3449  2015-06-12 09:06  HotelSystemmainwidget.h
     文件      137984  2015-06-12 08:59  HotelSystemmainwidget.ui
     文件        1349  2015-06-12 08:13  HotelSystemmainwindow.cpp
     文件        8121  2015-06-12 00:22  HotelSystemorder.cpp
     文件        3701  2015-06-11 21:40  HotelSystemquery.cpp
     文件        1747  2015-06-11 21:42  HotelSystem
oomSetting.cpp
     文件        2627  2015-06-11 21:40  HotelSystemsystemSetting.cpp
     文件         423  2015-06-12 09:09  HotelSystem ime.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个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)