Compare commits

..

31 Commits

@ -9,23 +9,44 @@ CONFIG += c++17
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
add_administration.cpp \
administration.cpp \
cellstatus.cpp \
checkbtn.cpp \
customer.cpp \
customerinfo.cpp \
main.cpp \
login.cpp \
receptionist.cpp
orderoom.cpp \
receptionist.cpp \
registers.cpp \
resetmessage.cpp
HEADERS += \
add_administration.h \
administration.h \
cellstatus.h \
checkbtn.h \
customer.h \
customerinfo.h \
login.h \
receptionist.h
orderoom.h \
receptionist.h \
registers.h \
resetmessage.h
FORMS += \
add_administration.ui \
administration.ui \
cellstatus.ui \
checkbtn.ui \
customer.ui \
customerinfo.ui \
login.ui \
receptionist.ui
orderoom.ui \
receptionist.ui \
registers.ui \
resetmessage.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
@ -34,3 +55,5 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
RESOURCES += \
res.qrc
DISTFILES +=

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 9.0.2, 2023-08-17T17:27:20. -->
<!-- Written by QtCreator 9.0.2, 2023-09-12T14:14:54. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -95,8 +95,8 @@
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\git\Hotel_Management\hotel\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/git/Hotel_Management/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -134,8 +134,8 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\git\Hotel_Management\hotel\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/git/Hotel_Management/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -175,8 +175,8 @@
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\git\Hotel_Management\hotel\..\build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/git/Hotel_Management/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -236,184 +236,21 @@
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/Documents/qt/Hotel_Management/Hotel_Management.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">F:/Documents/qt/Hotel_Management/Hotel_Management.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/git/Hotel_Management/hotel/Hotel_Management.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">F:/git/Hotel_Management/hotel/Hotel_Management.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/Documents/qt/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">桌面</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{6973527e-3e45-46d9-b5b3-3fa7130f50c5}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-unknown-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-unknown-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-unknown-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-unknown-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\Documents\qt\Hotel_Management\..\build-Hotel_Management-unknown-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/Documents/qt/build-Hotel_Management-unknown-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/git/Hotel_Management/build-Hotel_Management-Desktop_Qt_5_15_2_MinGW_64_bit-Debug</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">2</value>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>

@ -1,2 +1,7 @@
# hotel
# 基于Qt开发的宾馆客房管理系统
## 系统的基本功能
1. 客房各种信息,包括客房的类别、当前的状态、负责人等;
2. 客房信息的查询和修改,包括按房间号查询住宿情况、按客户信息查询房间状态等;
3. 退房、订房、换房等信息的修改,对查询、统计结果打印输出。

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@ -0,0 +1,42 @@
#include "add_administration.h"
#include "ui_add_administration.h"
#include "administration.h"
add_administration::add_administration(QWidget *parent) :
QDialog(parent),
ui(new Ui::add_administration)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("提示");
this->setFixedSize(400,300);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/add.jpg"));
bg->lower();
}
add_administration::~add_administration()
{
delete ui;
}
void add_administration::paintEvent(QPaintEvent*)
{
bg->resize(ui->widget->size());
}
void add_administration::on_pushButton_clicked()
{
//administration *ad = new administration;
QSqlQuery query((db));
query.prepare("INSERT into room VALUES(:n,1,1,1,1,NULL,NULL);");
query.bindValue(":n",ui->lineEdit->text());
query.exec();
QMessageBox::information(this,tr("提示"),("添加成功,请刷新"));
this->hide();
}

@ -0,0 +1,33 @@
#ifndef ADD_ADMINISTRATION_H
#define ADD_ADMINISTRATION_H
#include <QDialog>
#include <qsqldatabase.h>
#include <administration.h>
#include <QLabel>
namespace Ui {
class add_administration;
}
class add_administration : public QDialog
{
Q_OBJECT
public:
explicit add_administration(QWidget *parent = nullptr);
~add_administration();
protected:
void paintEvent(QPaintEvent*);
private slots:
void on_pushButton_clicked();
private:
Ui::add_administration *ui;
QSqlDatabase db;
QLabel *bg;
};
#endif // ADD_ADMINISTRATION_H

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>add_administration</class>
<widget class="QDialog" name="add_administration">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>50</x>
<y>90</y>
<width>301</width>
<height>81</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>房间号:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>150</x>
<y>230</y>
<width>100</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -1,14 +1,515 @@
#include "administration.h"
#include "ui_administration.h"
#include "registers.h"
#include "add_administration.h"
administration::administration(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::administration)
ui(new Ui::administration){
init();
}
void administration::paintEvent(QPaintEvent*)
{
ui->setupUi(this);
labels->resize(ui->widget->size());
}
void administration::init()
{
ui->setupUi(this);
this->setFixedSize(1920,1080);
this->setWindowTitle("用户界面");
this->setWindowIcon(QIcon(":image/icon/logo"));
labels = new QLabel(this);
labels->setScaledContents(true);
labels->setFixedSize(1920,1080);
labels->setPixmap(QPixmap(":/image/bg/login.png"));
labels->lower();
ui->HotelTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->AcounTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->AcounTable->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->AcounTable->verticalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//行头透明度
ui->HotelTable->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->HotelTable->verticalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//行头透明度
ui->Add->setEnabled(false);//初始退订按钮灰色
ui->Del->setEnabled(false);//初始退订按钮灰色
ui->Modify->setEnabled(false);//初始退订按钮灰色
ui->Search->setEnabled(false);//初始退订按钮灰色
ui->AcounTable->hide();
ui->HotelTable->hide();
on_Hman_clicked();
}
void administration::init_account(){
findall2();
flush_data2(userinfo);
value_customer = ui->AcounTable->model()->rowCount();
findall3();
flush_data3(userinfo);
ui->AcounTable->setHorizontalHeaderLabels({"客户账号","密码","姓名","性别","身份证"});
}
void administration::init_hotel(){
findall();
flush_data(userinfo);
ui->HotelTable->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态"});
}
administration::~administration()
{
delete ui;
}
//切换到Hotel table,同时关闭Acount table
void administration::on_Hman_clicked()
{
ui->Add->setEnabled(true);//初始退订按钮灰色
ui->Del->setEnabled(true);//初始退订按钮灰色
ui->Modify->setEnabled(true);//初始退订按钮灰色
ui->Search->setEnabled(true);//初始退订按钮灰色
init_hotel();
ui->HotelTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->HotelTable->setSelectionBehavior(QAbstractItemView::SelectRows); //整行选中的方式
ui->HotelTable->setSelectionMode(QAbstractItemView::SingleSelection); //设置可以选中单个
ui->HotelTable->show();
ui->AcounTable->hide();
tool = 1;
}
//切换到Acount table,同时关闭Hotel table
void administration::on_Aman_clicked()
{
ui->Add->setEnabled(true);//初始退订按钮灰色
ui->Del->setEnabled(true);//初始退订按钮灰色
ui->Modify->setEnabled(true);//初始退订按钮灰色
ui->Search->setEnabled(true);//初始退订按钮灰色
init_account();
ui->AcounTable->setSelectionBehavior(QAbstractItemView::SelectRows); //整行选中的方式
ui->AcounTable->setSelectionMode(QAbstractItemView::SingleSelection); //设置可以选中单个
ui->HotelTable->hide();
ui->AcounTable->show();
tool = 0;
}
//增加行 完成
void administration::on_Add_clicked()
{
if(tool == 0){
registers *reg = new registers;
reg->settype(2);
reg->show();
/*int cols=ui->AcounTable->columnCount();
int rows=ui->AcounTable->rowCount();
qDebug()<<rows;
ui->AcounTable->insertRow(rows);
for(int i=0;i<cols;i++)
{
ui->AcounTable->setItem(rows,i,new QTableWidgetItem(""));
}
ui->AcounTable->selectRow(rows);
QSqlQuery query((db));
query.prepare("INSERT into customer VALUES(:n,1,1,1,1,NULL);");
query.bindValue(":n",QRandomGenerator::global()->bounded(10000));//随机数 一万以内正整数
query.exec();
QMessageBox::information(this,tr("提示"),("添加成功"));
init_account();*/
}
else if(tool == 1){
int cols=ui->HotelTable->columnCount();
int rows=ui->HotelTable->rowCount();
ui->HotelTable->insertRow(rows);
for(int i=0;i<cols;i++)
{
ui->HotelTable->setItem(rows,i,new QTableWidgetItem(""));
}
ui->HotelTable->selectRow(rows);
add_administration *ad = new add_administration;
ad->show();
}
else QMessageBox::about(this,"警告","出错");
}
//删除操作 完成
void administration::on_Del_clicked()
{
if(tool == 0){
//if(row <= value_customer-userinfo.size()+1){
QSqlQuery query((db));
QTableWidgetItem *item = ui->AcounTable->currentItem();
QString n = 0;
n = ui->AcounTable->model()->index(item->row(),0).data().toString();
//int num = n.toInt();
query.prepare("DELETE from customer where account = :num ");
query.bindValue(":num",n);
query.exec();
query.prepare("DELETE from employee where account = :num ");
query.bindValue(":num",n);
query.exec();
if(item==Q_NULLPTR)return;
ui->AcounTable->removeRow(item->row());
QMessageBox::information(this,tr("提示"),("删除成功"));
init_account();
// }
/* else if(row > value_customer-userinfo.size()){
QSqlQuery query((db));
QTableWidgetItem *item = ui->AcounTable->currentItem();
QString n = 0;
n = ui->AcounTable->model()->index(item->row(),0).data().toString();//n是房间号
int num = n.toInt();
if(item==Q_NULLPTR)return;
ui->AcounTable->removeRow(item->row());
QMessageBox::information(this,tr("提示"),("删除成功"));
init_account();
}*/
}
else if(tool == 1){
QSqlQuery query((db));
QTableWidgetItem *item = ui->HotelTable->currentItem();
QString n = 0;
n = ui->HotelTable->model()->index(item->row(),0).data().toString();//n是房间号
int num = n.toInt();
query.prepare("DELETE from room where room_num = :num ");
query.bindValue(":num",num);
query.exec();
if(item==Q_NULLPTR)return;
ui->HotelTable->removeRow(item->row());
QMessageBox::information(this,tr("提示"),("删除成功"));
}
else QMessageBox::about(this,"警告","出错");
}
//修改操作
void administration::on_Modify_clicked()
{
int c = row;
if(tool == 0){
//if(row <= value_customer-userinfo.size()){
QSqlQuery query((db));
QString n1 = 0;
n1 = ui->AcounTable->model()->index(c,0).data().toString();//n是房间号
num = n1.toInt();
QString n2 = "0";
n2 = ui->AcounTable->model()->index(c,1).data().toString();
query.prepare("UPDATE customer set password=:QS where account = :num");
query.bindValue(":QS",n2);
query.bindValue(":num",n1);
query.exec();
QString n3 = 0;
n3 = ui->AcounTable->model()->index(c,2).data().toString();
query.prepare("UPDATE customer set name=:QS where account = :num");
query.bindValue(":QS",n3);
query.bindValue(":num",n1);
query.exec();
QString n4 = 0;
n4 = ui->AcounTable->model()->index(c,3).data().toString();
query.prepare("UPDATE customer set gender=:QS where account = :num");
query.bindValue(":QS",n4);
query.bindValue(":num",n1);
query.exec();
QString n5 = 0;
n5 = ui->AcounTable->model()->index(c,4).data().toString();
query.prepare("UPDATE customer set id=:QS where account = :num");
query.bindValue(":QS",n5);
query.bindValue(":num",n1);
query.exec();
query.prepare("UPDATE employee set password=:QS where account = :num");
query.bindValue(":QS",n2);
query.bindValue(":num",n1);
query.exec();
init_account();
// }
/* else if(row > value_customer-userinfo.size()){
QSqlQuery query((db));
QString n1 = 0;
n1 = ui->AcounTable->model()->index(row,0).data().toString();//n是房间号
num = n1.toInt();
QString n2 = "0";
n2 = ui->AcounTable->model()->index(row,1).data().toString();
init_account();*/
//}
}
else if(tool == 1){
QSqlQuery query((db));
QString n1 = 0;
n1 = ui->HotelTable->model()->index(c,0).data().toString();//n是房间号
num = n1.toInt();
QString n2 = "0";
n2 = ui->HotelTable->model()->index(c,1).data().toString();
query.prepare("UPDATE room set type=:QS where room_num = :num");
query.bindValue(":QS",n2);
query.bindValue(":num",num);
query.exec();
QString n3 = 0;
n3 = ui->HotelTable->model()->index(c,2).data().toString();
query.prepare("UPDATE room set withwindow=:QS where room_num = :num");
query.bindValue(":QS",n3);
query.bindValue(":num",num);
query.exec();
QString n4 = 0;
n4 = ui->HotelTable->model()->index(c,3).data().toString();
query.prepare("UPDATE room set responsible_person=:QS where room_num = :num");
query.bindValue(":QS",n4);
query.bindValue(":num",num);
query.exec();
QString n5 = 0;
n5 = ui->HotelTable->model()->index(c,4).data().toString();
query.prepare("UPDATE room set status=:QS where room_num = :num");
query.bindValue(":QS",n5);
query.bindValue(":num",num);
query.exec();
init_hotel();
}
QMessageBox::information(this,tr("提示"),("修改成功"));
}
//插入账号数据
void administration::flush_data2(QVector<QVector<QString>>&userinfo)//插入数据 完成
{
ui->AcounTable->clear();
if(!userinfo.size())return;
ui->AcounTable->setRowCount(userinfo.size());//行
ui->AcounTable->setColumnCount(5);//列
for(int i=0;i<userinfo.size();i++)
{
for(int j=0;j<userinfo[0].size();j++)
{
QTableWidgetItem *QW = new QTableWidgetItem(userinfo[i][j]);
ui->AcounTable->setItem(i,j,QW);//行 列 内容
QW->setTextAlignment(Qt::AlignCenter);//设置中心对齐
}
}
}
//插入客房数据
void administration::flush_data(QVector<QVector<QString>>&userinfo)//插入数据 完成
{
ui->HotelTable->clear();
if(!userinfo.size())return;
ui->HotelTable->setRowCount(userinfo.size());//行
ui->HotelTable->setColumnCount(5);//列
for(int i=0;i<userinfo.size();i++)
{
for(int j=0;j<userinfo[0].size();j++)
{
QTableWidgetItem *QW = new QTableWidgetItem(userinfo[i][j]);
ui->HotelTable->setItem(i,j,QW);//行 列 内容
QW->setTextAlignment(Qt::AlignCenter);//设置中心对齐
}
}
}
void administration::flush_data3(QVector<QVector<QString>>&userinfo)//插入数据 完成
{
//ui->AcounTable->clear();
if(!userinfo.size())return;
ui->AcounTable->setRowCount(userinfo.size()+ui->AcounTable->model()->rowCount());//行
//ui->AcounTable->setColumnCount(5);//列
for(int i=0;i<userinfo.size();i++)
{
for(int j=0;j<userinfo[0].size();j++)
{
QTableWidgetItem *QW = new QTableWidgetItem(userinfo[i][j]);
QTableWidgetItem *QW2 = new QTableWidgetItem("/");
QTableWidgetItem *QW3 = new QTableWidgetItem("/");
QTableWidgetItem *QW4 = new QTableWidgetItem("/");
ui->AcounTable->setItem(i+ui->AcounTable->model()->rowCount()-userinfo.size(),j,QW);//行 列 内容
ui->AcounTable->setItem(i+ui->AcounTable->model()->rowCount()-userinfo.size(),2,QW2);
ui->AcounTable->setItem(i+ui->AcounTable->model()->rowCount()-userinfo.size(),3,QW3);
ui->AcounTable->setItem(i+ui->AcounTable->model()->rowCount()-userinfo.size(),4,QW4);
QW->setTextAlignment(Qt::AlignCenter);//设置中心对齐
QW2->setTextAlignment(Qt::AlignCenter);
QW3->setTextAlignment(Qt::AlignCenter);
QW4->setTextAlignment(Qt::AlignCenter);
}
}
}
//搜索
void administration::findall()//显示全部 完成
{
userinfo.clear();//清楚存储向量rec的向量的数据
QSqlQuery query((db));
query.prepare("select * from room");
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
for(int i=0;i<query.record().count();i++)
{
rec.push_back(query.record().value(i).toString());//将sql搜索到的一行记录塞入rec向量
}
userinfo.push_back(rec);//将rec向量塞入向量
}
}
}
void administration::findall2()//显示全部 完成
{
userinfo.clear();//清楚存储向量rec的向量的数据
QSqlQuery query((db));
query.prepare("select * from customer");
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
for(int i=0;i<query.record().count();i++)
{
rec.push_back(query.record().value(i).toString());//将sql搜索到的一行记录塞入rec向量
}
userinfo.push_back(rec);//将rec向量塞入向量
}
}
}
void administration::findall3()//显示全部 完成
{
userinfo.clear();//清楚存储向量rec的向量的数据
QSqlQuery query((db));
query.prepare("select * from employee");
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
for(int i=0;i<query.record().count();i++)
{
rec.push_back(query.record().value(i).toString());//将sql搜索到的一行记录塞入rec向量
}
userinfo.push_back(rec);//将rec向量塞入向量
}
}
}
void administration::on_Search_clicked()
{
QString number=ui->lineEdit->text();
if(number == NULL && tool == 0){
init_account();
}
else if(number == NULL && tool == 1){
init_hotel();
}
else if(find_byname2(number) && tool == 0)
{
flush_data2(userinfo);
userinfo.clear();
if(ui->AcounTable->model()->index(0,0).data().toString() != NULL)condition_search = 1;
if(condition_search == 0 && find_byname3(number) && tool == 0){
flush_data2(userinfo);
userinfo.clear();
}
condition_search = 0;
ui->AcounTable->setHorizontalHeaderLabels({"客户账号","密码","姓名","性别","身份证"});
}
else if(find_byname(number) && tool == 1){
flush_data(userinfo);
userinfo.clear();
ui->HotelTable->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态"});
}
else QMessageBox::critical(nullptr, "错误", "未知的错误", QMessageBox::Retry);
}
bool administration::find_byname(QString n)//搜索 完成
{
int number = n.toInt();
userinfo.clear();
QSqlQuery query(db);
query.prepare("select * from room where room_num like :number;");//以开头搜索 不行
query.bindValue(":number",number);
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
rec.push_back(query.record().value("room_num").toString());
rec.push_back(query.record().value("type").toString());
rec.push_back(query.record().value("withwindow").toString());
rec.push_back(query.record().value("responsible_person").toString());
rec.push_back(query.record().value("status").toString());
rec.push_back(query.record().value("checkout_time").toString());
rec.push_back(query.record().value("customer_id").toString());
userinfo.push_back(rec);
}
return true;
}
return false;
}
bool administration::find_byname2(QString n)//搜索
{
userinfo.clear();
QSqlQuery query(db);
query.prepare("select * from customer where account like :number;");//以开头搜索 不行
query.bindValue(":number",n);
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
rec.push_back(query.record().value("account").toString());
rec.push_back(query.record().value("password").toString());
rec.push_back(query.record().value("name").toString());
rec.push_back(query.record().value("gender").toString());
rec.push_back(query.record().value("id").toString());
userinfo.push_back(rec);
}
return true;
}
return false;
}
bool administration::find_byname3(QString n)//搜索
{
userinfo.clear();
QSqlQuery query(db);
query.prepare("select * from employee where account like :number;");//以开头搜索 不行
query.bindValue(":number",n);
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
rec.push_back(query.record().value("account").toString());
rec.push_back(query.record().value("password").toString());
userinfo.push_back(rec);
}
return true;
}
return false;
}
void administration::on_AcounTable_itemClicked(QTableWidgetItem *item)
{
row = item->row();
qDebug() << "当前选中行: " << row;
}
void administration::on_HotelTable_itemClicked(QTableWidgetItem *item)
{
row = item->row();
qDebug() << "当前选中行: " << row;
}

@ -1,7 +1,21 @@
#ifndef ADMINISTRATION_H
#define ADMINISTRATION_H
#include "login.h"
#include <QLabel>
#include <QTableWidget>
#include <QStringList>
#include <QApplication>
#include <QMainWindow>
#include <QIcon>
#include <QMessageBox>
#include <QTableWidgetItem>
#include <QSqlRecord>
#include <resetmessage.h>
#include <QDate>
#include <QRandomGenerator>
#include <QDebug>
namespace Ui {
class administration;
@ -14,9 +28,52 @@ class administration : public QMainWindow
public:
explicit administration(QWidget *parent = nullptr);
~administration();
void init();
void findall();
void findall2();
void findall3();
void init_hotel();
void init_account();
private slots:
void on_Aman_clicked();
void on_Add_clicked();
void on_Del_clicked();
void on_Hman_clicked();
void on_Modify_clicked();
void on_Search_clicked();
void on_AcounTable_itemClicked(QTableWidgetItem *item);
void on_HotelTable_itemClicked(QTableWidgetItem *item);
protected:
void paintEvent(QPaintEvent*);
private:
Ui::administration *ui;
QTableWidget *TableWidget;
QLabel *labels;
void flush_data(QVector<QVector<QString>>&userinfo);
void flush_data2(QVector<QVector<QString>>&userinfo);
void flush_data3(QVector<QVector<QString>>&userinfo);
QVector<QVector<QString>>userinfo;
bool find_byname(QString name);
bool find_byname2(QString name);
bool find_byname3(QString name);
QSqlDatabase db;
int row;
int n = 1000;
int m =1000;
int tool = 0;
int num;
int value_customer;
int value_employee;
int condition_search = 0;
};
#endif // ADMINISTRATION_H

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>2079</width>
<height>1453</height>
</rect>
</property>
<property name="windowTitle">
@ -23,6 +23,271 @@
<height>1080</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>-10</y>
<width>831</width>
<height>321</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>70</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:72pt; font-weight:700; color:#00ffff;&quot;&gt;宜客酒店&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="Hman">
<property name="geometry">
<rect>
<x>980</x>
<y>90</y>
<width>291</width>
<height>61</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);
border-radius:15px;</string>
</property>
<property name="text">
<string>客房管理</string>
</property>
</widget>
<widget class="QPushButton" name="Aman">
<property name="geometry">
<rect>
<x>1290</x>
<y>90</y>
<width>271</width>
<height>61</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);
border-radius:15px;</string>
</property>
<property name="text">
<string>账号管理</string>
</property>
</widget>
<widget class="QTableWidget" name="AcounTable">
<property name="geometry">
<rect>
<x>120</x>
<y>290</y>
<width>1531</width>
<height>731</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
<column>
<property name="text">
<string>1</string>
</property>
</column>
<column>
<property name="text">
<string>2</string>
</property>
</column>
<column>
<property name="text">
<string>3</string>
</property>
</column>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>1290</x>
<y>200</y>
<width>161</width>
<height>71</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="Modify">
<property name="geometry">
<rect>
<x>1680</x>
<y>510</y>
<width>161</width>
<height>101</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);
border-radius:15px;</string>
</property>
<property name="text">
<string>更改</string>
</property>
</widget>
<widget class="QPushButton" name="Search">
<property name="geometry">
<rect>
<x>1450</x>
<y>200</y>
<width>111</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);</string>
</property>
<property name="text">
<string>搜索</string>
</property>
</widget>
<widget class="QPushButton" name="Add">
<property name="geometry">
<rect>
<x>1680</x>
<y>290</y>
<width>161</width>
<height>91</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);
border-radius:15px;</string>
</property>
<property name="text">
<string>添加</string>
</property>
</widget>
<widget class="QPushButton" name="Del">
<property name="geometry">
<rect>
<x>1680</x>
<y>400</y>
<width>161</width>
<height>91</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 170, 255);
border-radius:15px;</string>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
<widget class="QTableWidget" name="HotelTable">
<property name="geometry">
<rect>
<x>120</x>
<y>290</y>
<width>1531</width>
<height>731</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
<column>
<property name="text">
<string>1</string>
</property>
</column>
<column>
<property name="text">
<string>2</string>
</property>
</column>
<column>
<property name="text">
<string>3</string>
</property>
</column>
<column>
<property name="text">
<string>4</string>
</property>
</column>
<column>
<property name="text">
<string>5</string>
</property>
</column>
</widget>
<zorder>label</zorder>
<zorder>lineEdit</zorder>
<zorder>Aman</zorder>
<zorder>Hman</zorder>
<zorder>Modify</zorder>
<zorder>AcounTable</zorder>
<zorder>Search</zorder>
<zorder>Add</zorder>
<zorder>Del</zorder>
<zorder>HotelTable</zorder>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
@ -30,7 +295,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>2079</width>
<height>17</height>
</rect>
</property>

@ -0,0 +1,96 @@
#include "cellstatus.h"
#include "ui_cellstatus.h"
cellstatus::cellstatus(QWidget *parent) :
QWidget(parent),
ui(new Ui::cellstatus)
{
ui->setupUi(this);
ui->pushButton->setStyleSheet("border:2px groove gray;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);"
"border-radius:5px;");
ui->pushButton_2->setStyleSheet("border:2px groove gray;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);"
"border-radius:5px;");
ui->pushButton->setFixedSize(25,25);
ui->pushButton_2->setFixedSize(25,25);
ui->gridLayout->setMargin(5);
ui->pushButton->setEnabled(true);
ui->pushButton_2->setEnabled(false);
m_order = new orderoom();
connect(m_order,&orderoom::ordersuccess,this,&cellstatus::onordersuccess);
}
cellstatus::~cellstatus()
{
delete ui;
}
void cellstatus::setisused(bool i){
isused = i;
}
void cellstatus::setbtn(){
ui->pushButton->setEnabled(!isused);
ui->pushButton_2->setEnabled(isused);
}
void cellstatus::setcbtn(checkbtn* cbtn){
this->cbtn = cbtn;
}
void cellstatus::setroomNum(int roomNum)
{
this->roomNum = roomNum;
}
void cellstatus::setDB(QSqlDatabase db)
{
this->db = db;
}
void cellstatus::on_pushButton_clicked()
{
m_order->setroomNum(roomNum);
m_order->setDB(db);
m_order->show();
}
void cellstatus::on_pushButton_2_clicked()
{
QSqlQuery query;
query.prepare("select * from customer where room_num like :num;");
query.bindValue(":str",roomNum);
query.exec();
QString account = query.value(0).toString();
query.prepare("UPDATE customer set room_num=NULL where account = :a");
query.bindValue(":a",account);
query.exec();
query.prepare("UPDATE room set status=:QS where room_num = :num");
query.bindValue(":QS","空闲");
query.bindValue(":num",roomNum);
query.exec();
query.prepare("UPDATE room set checkout_time=NULL where room_num = :num");
query.bindValue(":num",roomNum);
query.exec();
query.prepare("UPDATE room set customer_id=NULL where room_num = :num");
query.bindValue(":num",roomNum);
query.exec();
QMessageBox::information(this," 预定信息 "," 退房成功 ");
ui->pushButton->setEnabled(true);
ui->pushButton_2->setEnabled(false);
cbtn->setisused(false);
cbtn->setbtn();
emit flash();
}
void cellstatus::onordersuccess()
{
QMessageBox::information(this,"预定信息","订房成功");
ui->pushButton->setEnabled(false);
ui->pushButton_2->setEnabled(true);
cbtn->setisused(true);
cbtn->setbtn();
emit flash();
}

@ -0,0 +1,47 @@
#ifndef CELLSTATUS_H
#define CELLSTATUS_H
#include <QWidget>
#include "orderoom.h"
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QMessageBox>
#include "checkbtn.h"
namespace Ui {
class cellstatus;
}
class cellstatus : public QWidget
{
Q_OBJECT
public:
explicit cellstatus(QWidget *parent = nullptr);
~cellstatus();
void setroomNum(int roomNum);
void setDB(QSqlDatabase db);
void setisused(bool i);
void setbtn();
void setcbtn(checkbtn* cbtn);
private slots:
void on_pushButton_clicked();
void on_pushButton_2_clicked();
void onordersuccess();
private:
Ui::cellstatus *ui;
int roomNum;
orderoom *m_order;
checkbtn *cbtn;
QSqlDatabase db;
bool isused;
signals:
void flash();
};
#endif // CELLSTATUS_H

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cellstatus</class>
<widget class="QWidget" name="cellstatus">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>订</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>退</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,40 @@
#include "checkbtn.h"
#include "ui_checkbtn.h"
#include "customerinfo.h"
#include <QDebug>
checkbtn::checkbtn(QWidget *parent) :
QWidget(parent),
ui(new Ui::checkbtn)
{
ui->setupUi(this);
}
checkbtn::~checkbtn()
{
delete ui;
}
void checkbtn::setroomNum(int roomNum){
this->roomNum = roomNum;
}
void checkbtn::setDB(QSqlDatabase db){
this->db = db;
}
void checkbtn::on_pushButton_clicked()
{
customerinfo *info = new customerinfo;
info->setDB(db);
info->setroomNum(roomNum);
info->show();
}
void checkbtn::setisused(bool i){
isused = i;
}
void checkbtn::setbtn(){
ui->pushButton->setEnabled(isused);
}

@ -0,0 +1,33 @@
#ifndef CHECKBTN_H
#define CHECKBTN_H
#include <QWidget>
#include <QSqlDatabase>
namespace Ui {
class checkbtn;
}
class checkbtn : public QWidget
{
Q_OBJECT
public:
explicit checkbtn(QWidget *parent = nullptr);
~checkbtn();
void setroomNum(int roomNum);
void setDB(QSqlDatabase db);
void setisused(bool i);
void setbtn();
private slots:
void on_pushButton_clicked();
private:
Ui::checkbtn *ui;
int roomNum;
QSqlDatabase db;
bool isused;
};
#endif // CHECKBTN_H

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>checkbtn</class>
<widget class="QWidget" name="checkbtn">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>查看</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -5,10 +5,284 @@ customer::customer(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::customer)
{
ui->setupUi(this);
init();
}
customer::~customer()
{
delete ui;
}
void customer::paintEvent(QPaintEvent*)
{
labelone->resize(ui->widget->size());
}
void customer::init()//初始化 完成
{
account_roomaccount = 0;//账户订房的数量
ui->setupUi(this);
this->setFixedSize(1920,1080);
this->setWindowTitle("用户界面");
this->setWindowIcon(QIcon(":image/icon/logo"));//创造本界面
rm = new ResetMessage(this);
rm->hide();//创造副界面
labelone = new QLabel(this);
labelone->setScaledContents(true);
labelone->setPixmap(QPixmap(":/image/bg/login.png"));
labelone->lower();
findall();
flush_data(userinfo);//初始显示全部
setmousehand();//装饰鼠标
ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->tableWidget->verticalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//行头透明度
ui->tableWidget->setColumnHidden(5, true);
ui->tableWidget->setColumnHidden(6, true);//隐藏列
ui->Reservation1->setEnabled(false);
ui->checking_out1->setEnabled(false);//初始退订按钮灰色
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);//表格不可编辑
}
void customer::setid(QString str)
{
id = str;
QSqlQuery query;
query.prepare("select * from customer where account like :id");
query.exec();
if(query.value(5)!=NULL){
account_roomaccount = 1;
}else{
account_roomaccount = 0;
}
}
void customer::setmousehand()//鼠标小手 完成
{
ui->search->setCursor(QCursor(Qt::PointingHandCursor));
ui->pushButton->setCursor(QCursor(Qt::PointingHandCursor));
ui->Reservation1->setCursor(QCursor(Qt::PointingHandCursor));
ui->checking_out1->setCursor(QCursor(Qt::PointingHandCursor));
}
void customer::on_checking_out1_clicked()//退房 完成
{
int c = row;//总之是获取选中的行
if( ui->tableWidget->model()->index(c,6).data().toString() == id )//id对上
{
account_roomaccount = 0;
QString QS = "空闲";
QSqlQuery query((db));
QString n = 0;
n = ui->tableWidget->model()->index(c,0).data().toString();//n是房间号
int num = n.toInt();
query.prepare("UPDATE room set status=:QS where room_num = :num");
query.bindValue(":QS",QS);
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE room set checkout_time=NULL where room_num = :num");
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE room set customer_id=NULL where room_num = :num");
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE customer set room_num=NULL where account = :a");
query.bindValue(":a",id);
query.exec();//开始操作数据库
if(c >= 0){
QTableWidgetItem *Q1 = new QTableWidgetItem(QS);
ui->tableWidget->setItem(c,4,Q1);
ui->tableWidget->setItem(c,6,NULL);//修改隐藏的第七列以供其他函数使用
Q1->setTextAlignment(Qt::AlignCenter);//中心
QMessageBox::about(this,"提示","退房成功");
ui->Reservation1->setEnabled(true);
ui->checking_out1->setEnabled(false);//合理设置按钮
}
}
else QMessageBox::about(this,"警告","不是本人操作");
}
void customer::on_Reservation1_clicked()//订房 完成
{
int c = row;//总之是获取选中的行
if(account_roomaccount == 0){
account_roomaccount = 1;
QString QS = "使用";
QSqlQuery query((db));
QString n = 0;
n = ui->tableWidget->model()->index(c,0).data().toString();
QDate d = QDate::currentDate();
int num = n.toInt();
query.prepare("UPDATE room set status=:QS where room_num = :num");
query.bindValue(":QS",QS);
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE room set checkout_time=DATE_ADD(:d, INTERVAL 1 DAY) where room_num = :num");
query.bindValue(":d",d);
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE room set customer_id=:id where room_num = :num");
query.bindValue(":id",id);
query.bindValue(":num",num);
query.exec();
query.prepare("UPDATE customer set room_num=:rn where account = :a");
query.bindValue(":a",id);
query.bindValue(":rn",num);
query.exec();//操作数据库
if(c>=0){
QTableWidgetItem *Q1 = new QTableWidgetItem(QS);
QTableWidgetItem *Q3 = new QTableWidgetItem(id);
ui->tableWidget->setItem(c,4,Q1);
ui->tableWidget->setItem(c,6,Q3);//修改隐藏的第七列以供其他函数使用
Q1->setTextAlignment(Qt::AlignCenter);
QMessageBox::about(this,"提示","订房成功");
ui->Reservation1->setEnabled(false);
ui->checking_out1->setEnabled(true);//合理设置按钮
}
}
else QMessageBox::about(this,"警告","一个账户只能预定一个房间");
}
void customer::on_pushButton_clicked()//显示修改密码界面 完成
{
rm->getid(id);//将id传过去
rm->show();
}
void customer::on_checkBox_clicked(bool checked)//装饰品 完成
{
if(checked){
ui->tableWidget->horizontalHeader()->show();
}
else ui->tableWidget->horizontalHeader()->hide();
}
void customer::on_checkBox_2_clicked(bool checked)//装饰品 完成
{
if(checked){
ui->tableWidget->verticalHeader()->show();
}
else ui->tableWidget->verticalHeader()->hide();
}
void customer::findall()//显示全部 完成
{
userinfo.clear();//清楚存储向量rec的向量的数据
QSqlQuery query((db));
query.prepare("select * from room");
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
for(int i=0;i<query.record().count();i++)
{
rec.push_back(query.record().value(i).toString());//将sql搜索到的一行记录塞入rec向量
}
userinfo.push_back(rec);//将rec向量塞入向量
}
}
}
void customer::flush_data(QVector<QVector<QString>>&userinfo)//插入数据 完成
{
ui->tableWidget->clear();
if(!userinfo.size())return;
ui->tableWidget->setRowCount(userinfo.size());//行
ui->tableWidget->setColumnCount(7);//列
for(int i=0;i<userinfo.size();i++)
{
for(int j=0;j<userinfo[0].size();j++)
{
QTableWidgetItem *QW = new QTableWidgetItem(userinfo[i][j]);
ui->tableWidget->setItem(i,j,QW);//行 列 内容
QW->setTextAlignment(Qt::AlignCenter);//设置中心对齐
}
}
ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态"});//设置表头
}
void customer::on_tableWidget_itemClicked(QTableWidgetItem *item)//点击表格格子 获取行数 完成
{
row = item->row();
if(ui->tableWidget->model()->index(row,4).data().toString() == "空闲"){
ui->Reservation1->setEnabled(true);
ui->checking_out1->setEnabled(false);//合理设置按钮
}
else if(ui->tableWidget->model()->index(row,4).data().toString() == "使用"){
ui->checking_out1->setEnabled(true);
ui->Reservation1->setEnabled(false);//合理设置按钮
}
else QMessageBox::about(this,"警告","未知错误");
}
void customer::on_search_clicked()//搜索 不能部分找到全部
{
QString number=ui->lineEdit_2->text();
if(number == NULL)//搜索栏空就显示全部
{
findall();
flush_data(userinfo);
}
else if(find_byname(number))
{
flush_data(userinfo);
userinfo.clear();
}else QMessageBox::critical(nullptr, "错误", "未知的错误", QMessageBox::Retry);
}
bool customer::find_byname(QString n)//搜索 完成
{
int number = n.toInt();
userinfo.clear();
QSqlQuery query(db);
query.prepare("select * from room where room_num like :number;");//以开头搜索 不行
query.bindValue(":number",number);
if(query.exec())
{
while (query.next()) {
QVector<QString>rec;
rec.push_back(query.record().value("room_num").toString());
rec.push_back(query.record().value("type").toString());
rec.push_back(query.record().value("withwindow").toString());
rec.push_back(query.record().value("responsible_person").toString());
rec.push_back(query.record().value("status").toString());
rec.push_back(query.record().value("checkout_time").toString());
rec.push_back(query.record().value("customer_id").toString());//一行数据全部塞进向量rec
userinfo.push_back(rec);
}
return true;
}
return false;
}

@ -2,6 +2,13 @@
#define CUSTOMER_H
#include <QMainWindow>
#include <QLabel>
#include <QIcon>
#include <QMessageBox>
#include <QTableWidgetItem>
#include <QSqlRecord>
#include <resetmessage.h>
#include <QDate>
namespace Ui {
class customer;
@ -14,9 +21,42 @@ class customer : public QMainWindow
public:
explicit customer(QWidget *parent = nullptr);
~customer();
void addrow(QString name,QString gender,int age,QString bornplace);
void findall();
void flush_data(QVector<QVector<QString>>&userinfo);
bool find_byname(QString name);
void setmousehand();
void setid(QString str);
void init();
private slots:
void on_checking_out1_clicked();
void on_Reservation1_clicked();
void on_checkBox_clicked(bool checked);
void on_checkBox_2_clicked(bool checked);
void on_tableWidget_itemClicked(QTableWidgetItem *item);
void on_search_clicked();
void on_pushButton_clicked();
protected:
void paintEvent(QPaintEvent*);
private:
Ui::customer *ui;
QLabel *labelone;
ResetMessage *rm;
QSqlDatabase db;
QVector<QVector<QString>>userinfo;
int row;
QString id;
int account_roomaccount;
};
#endif // CUSTOMER_H

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>1920</width>
<height>1080</height>
</rect>
</property>
<property name="windowTitle">
@ -17,12 +17,255 @@
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<x>20</x>
<y>-50</y>
<width>1920</width>
<height>1080</height>
</rect>
</property>
<widget class="QToolButton" name="Reservation1">
<property name="geometry">
<rect>
<x>1777</x>
<y>666</y>
<width>60</width>
<height>60</height>
</rect>
</property>
<property name="text">
<string>订</string>
</property>
</widget>
<widget class="QToolButton" name="checking_out1">
<property name="geometry">
<rect>
<x>1777</x>
<y>555</y>
<width>60</width>
<height>60</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>退</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="sign">
<property name="geometry">
<rect>
<x>-10</x>
<y>-20</y>
<width>531</width>
<height>321</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>70</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(85, 255, 255);</string>
</property>
<property name="text">
<string>宜客酒店</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>1250</x>
<y>200</y>
<width>161</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>990</x>
<y>200</y>
<width>251</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>25</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color:rgb(255, 255, 255)</string>
</property>
<property name="text">
<string>房间检索:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>120</x>
<y>290</y>
<width>1531</width>
<height>731</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);
</string>
</property>
<column>
<property name="text">
<string>房间号</string>
</property>
</column>
<column>
<property name="text">
<string>房间类型</string>
</property>
</column>
<column>
<property name="text">
<string>是否带窗</string>
</property>
</column>
<column>
<property name="text">
<string>负责人</string>
</property>
</column>
<column>
<property name="text">
<string>状态</string>
</property>
</column>
</widget>
<widget class="QPushButton" name="search">
<property name="geometry">
<rect>
<x>1450</x>
<y>200</y>
<width>111</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>22</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;
background-color: rgb(108, 162, 162);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>搜索</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>1770</x>
<y>90</y>
<width>91</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>25</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">image:url(:/image/icon/resetcode.png);
background-color: rgba(0, 0, 0, 0);
</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>1760</x>
<y>820</y>
<width>129</width>
<height>219</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="styleSheet">
<string notr="true">color:rgb(255, 255, 255)</string>
</property>
<property name="text">
<string>行表头</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="styleSheet">
<string notr="true">color:rgb(255, 255, 255)</string>
</property>
<property name="text">
<string>列表头</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
@ -30,7 +273,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>1920</width>
<height>17</height>
</rect>
</property>

@ -0,0 +1,57 @@
#include "customerinfo.h"
#include "ui_customerinfo.h"
#include <QDebug>
customerinfo::customerinfo(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::customerinfo)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("客户信息");
this->setFixedSize(800,600);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/register.jpg"));
bg->lower();
ui->lineEdit->setEnabled(false);
ui->lineEdit_2->setEnabled(false);
ui->lineEdit_3->setEnabled(false);
ui->lineEdit_4->setEnabled(false);
}
customerinfo::~customerinfo()
{
delete ui;
}
void customerinfo::paintEvent(QPaintEvent*)
{
bg->resize(ui->widget->size());
QSqlQuery query;
query.prepare("select * from customer where room_num like :roomNum;");
query.bindValue(":roomNum",roomNum);
query.exec();
if(query.next()){
ui->lineEdit->setText(query.value(0).toString());
ui->lineEdit_2->setText(query.value(2).toString());
ui->lineEdit_3->setText(query.value(3).toString());
ui->lineEdit_4->setText(query.value(4).toString());
}
}
void customerinfo::setroomNum(int roomNum){
this->roomNum = roomNum;
}
void customerinfo::setDB(QSqlDatabase db){
this->db = db;
}
void customerinfo::on_pushButton_clicked()
{
this->hide();
}

@ -0,0 +1,36 @@
#ifndef CUSTOMERINFO_H
#define CUSTOMERINFO_H
#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QLabel>
namespace Ui {
class customerinfo;
}
class customerinfo : public QMainWindow
{
Q_OBJECT
public:
explicit customerinfo(QWidget *parent = nullptr);
~customerinfo();
void setDB(QSqlDatabase db);
void setroomNum(int roomNum);
protected:
void paintEvent(QPaintEvent*);
private slots:
void on_pushButton_clicked();
private:
Ui::customerinfo *ui;
QSqlDatabase db;
int roomNum;
QLabel *bg;
};
#endif // CUSTOMERINFO_H

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>customerinfo</class>
<widget class="QMainWindow" name="customerinfo">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>700</width>
<height>450</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>账号(手机号)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>姓名:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>性别:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_3">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>身份证号:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_4">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>325</x>
<y>500</y>
<width>150</width>
<height>50</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>17</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

@ -3,6 +3,7 @@
#include "customer.h"
#include "administration.h"
#include "receptionist.h"
#include "registers.h"
login::login(QWidget *parent)
: QMainWindow(parent)
@ -11,7 +12,7 @@ login::login(QWidget *parent)
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
setWindowTitle("宜客酒店");
this->setWindowTitle("宜客酒店");
this->setFixedSize(1920,1080);
bg = new QLabel(this);
bg->setScaledContents(true);
@ -19,7 +20,6 @@ login::login(QWidget *parent)
bg->lower();
db = QSqlDatabase::addDatabase("QMYSQL");
db.setDatabaseName("hotel");
db.setHostName("localhost");
db.setPort(3306);
db.setUserName("root");
@ -29,6 +29,9 @@ login::login(QWidget *parent)
}else{
qDebug("database connect failed");
}
QSqlQuery query;
query.exec("CREATE DATABASE IF NOT EXISTS hotel;USE hotel;CREATE TABLE IF NOT EXISTS customer (account VARCHAR ( 20 ) PRIMARY KEY,password VARCHAR ( 20 ) NOT NULL,name VARCHAR ( 16 ) NOT NULL,gender VARCHAR ( 5 ) NOT NULL,id VARCHAR ( 16 ) NOT NULL,room_num INT );CREATE TABLE IF NOT EXISTS room (room_num INT PRIMARY KEY,type VARCHAR ( 20 ) NOT NULL,withwindow VARCHAR ( 5 ) NOT NULL,responsible_person VARCHAR ( 16 ) NOT NULL,status VARCHAR ( 12 ) NOT NULL,checkout_time date,customer_id VARCHAR ( 16 ) );CREATE TABLE IF NOT EXISTS employee (account VARCHAR ( 20 ) PRIMARY KEY, password VARCHAR ( 20 ) NOT NULL);ALTER TABLE customerADD FOREIGN KEY ( room_num ) REFERENCES room ( room_num ) ON DELETE SET NULL;ALTER TABLE room ADD FOREIGN KEY ( customer_id ) REFERENCES customer ( account ) ON DELETE SET NULL;");
db.setDatabaseName("hotel");
ui->lineEdit_password->setEchoMode(QLineEdit::Password);
@ -46,34 +49,9 @@ void login::paintEvent(QPaintEvent*)
void login::on_btn_info_clicked()
{
QMessageBox::about(this, tr("关于我们"), tr("《宾馆客房管理系统》\n\n开发团队:\n\n项目总监:\n美术设计:\n程序设计: \n界面设计:\n系统测试:\n\nCopyright© 2023 xxx All Right Reserved."));
}
void login::on_pushButton_2_clicked()
{
customer *cus = new customer;
this->hide();
cus->show();
}
void login::on_pushButton_3_clicked()
{
receptionist *rec = new receptionist;
this->hide();
rec->show();
}
void login::on_pushButton_4_clicked()
{
administration *admin = new administration;
this->hide();
admin->show();
QMessageBox::about(this, tr("关于我们"), tr("《宾馆客房管理系统》\n\n开发团队Cyber Pigeon\n\n产品经理:雷张炜\n界面设计:雷张炜\n美术设计:雷张炜、周海康\n系统测试:余朴\n软件分析:曹坤\n程序总监:雷张炜、周海康\n程序设计:雷张炜、周海康、余朴、曹坤\n\nCopyright© 2023 Cyber Pigeon® All Right Reserved."));
}
void login::on_btn_login_clicked()
{
bool isfind = false;
@ -95,6 +73,7 @@ void login::on_btn_login_clicked()
qDebug("login succeed");
isfind=true;
customer *cus = new customer;
cus->setid(ui->lineEdit_account->text());
this->hide();
cus->show();
break;
@ -122,3 +101,11 @@ void login::on_btn_login_clicked()
}
}
void login::on_btn_register_clicked()
{
registers *reg = new registers;
reg->settype(1);
reg->show();
}

@ -27,14 +27,10 @@ protected:
private slots:
void on_btn_info_clicked();
void on_pushButton_2_clicked();
void on_pushButton_3_clicked();
void on_pushButton_4_clicked();
void on_btn_login_clicked();
void on_btn_register_clicked();
private:
Ui::login *ui;
QLabel *bg;

@ -62,6 +62,9 @@
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>登录</string>
</property>
@ -83,6 +86,12 @@
<pointsize>16</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">radius:15px;</string>
</property>
<property name="text">
<string>注册</string>
</property>
@ -143,6 +152,9 @@
<pointsize>15</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_password">
<property name="geometry">
@ -158,6 +170,9 @@
<pointsize>15</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;</string>
</property>
</widget>
<widget class="QPushButton" name="btn_info">
<property name="geometry">
@ -176,66 +191,6 @@ background-color: rgba(0, 0, 0, 0);</string>
<string/>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>40</x>
<y>290</y>
<width>501</width>
<height>271</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>50</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>测试用</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>130</x>
<y>570</y>
<width>151</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>客户</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>130</x>
<y>620</y>
<width>151</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>前台</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>130</x>
<y>670</y>
<width>151</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>管理</string>
</property>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

@ -0,0 +1,112 @@
#include "orderoom.h"
#include "ui_orderoom.h"
#include "registers.h"
orderoom::orderoom(QWidget *parent) :
QWidget(parent),
ui(new Ui::orderoom)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("订房页面");
this->setFixedSize(800,600);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/order.png"));
bg->lower();
ui->tableWidget->setRowCount(0);
ui->tableWidget->setColumnCount(4);
ui->tableWidget->setHorizontalHeaderLabels({"手机号","姓名","性别","身份证号"});
ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->tableWidget->setStyleSheet("QTableWidget{border:2px groove gray;border-radius:15px;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);}");
ui->tableWidget->verticalHeader()->setVisible(false);
ui->tableWidget->setColumnWidth(0,200);
ui->tableWidget->setColumnWidth(1,100);
ui->tableWidget->setColumnWidth(2,100);
ui->tableWidget->setColumnWidth(3,375);
findcustomer = false;
}
orderoom::~orderoom()
{
delete ui;
}
void orderoom::setroomNum(int roomNum)
{
this->roomNum = roomNum;
}
void orderoom::setDB(QSqlDatabase db){
this->db = db;
}
void orderoom::on_btn_search_clicked()
{
QString str = ui->lineEdit->text();
ui->tableWidget->setRowCount(1);
ui->tableWidget->clear();
ui->tableWidget->setHorizontalHeaderLabels({"手机号","姓名","性别","身份证号"});
QSqlQuery query;
query.prepare("select * from customer where account like :str;");
query.bindValue(":str",str);
if(query.exec()){
while (query.next()){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(0).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(0,0,twi);
for(int j = 2;j<5;j++){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(0,j-1,twi);
}
}
}
if(ui->tableWidget->model()->index(0,0).data().toString() == NULL){
findcustomer = false;
ui->tableWidget->setRowCount(0);
}else{
findcustomer = true;
}
}
void orderoom::on_btn_order_clicked()
{
if(findcustomer){
QDate date = QDate::currentDate();
QString account = ui->tableWidget->model()->index(0,0).data().toString();
QString sql1 = QString("UPDATE room set customer_id = %1 where room_num = %2").arg(account).arg(roomNum);
QString sql2 = QString("UPDATE room set status='使用' where room_num = %1").arg(roomNum);
QString sql3 = QString("UPDATE customer set room_num=%1 where account = %2").arg(roomNum).arg(ui->tableWidget->model()->index(0,0).data().toString());
QSqlQuery query;
query.exec(sql1);
query.exec(sql2);
query.exec(sql3);
query.prepare("UPDATE room set checkout_time=DATE_ADD(:date, INTERVAL 1 DAY) where room_num = :num");
query.bindValue(":date",date);
query.bindValue(":num",roomNum);
query.exec();
emit ordersuccess();
this->close();
}else{
QMessageBox::warning(this,tr("提示"),("请选择入住客户!"));
}
}
void orderoom::on_btn_registers_clicked()
{
registers *reg = new registers;
reg->settype(1);
reg->show();
}

@ -0,0 +1,46 @@
#ifndef ORDEROOM_H
#define ORDEROOM_H
#include <QWidget>
#include <QLabel>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDate>
#include <QMessageBox>
#include <QDebug>
namespace Ui {
class orderoom;
}
class orderoom : public QWidget
{
Q_OBJECT
public:
explicit orderoom(QWidget *parent = nullptr);
~orderoom();
void setroomNum(int roomNum);
void setDB(QSqlDatabase db);
private slots:
void on_btn_search_clicked();
void on_btn_order_clicked();
void on_btn_registers_clicked();
private:
Ui::orderoom *ui;
QLabel *bg;
int roomNum;
QSqlDatabase db;
bool findcustomer;
signals:
void ordersuccess();
};
#endif // ORDEROOM_H

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>orderoom</class>
<widget class="QWidget" name="orderoom">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>200</x>
<y>60</y>
<width>461</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;</string>
</property>
</widget>
<widget class="QPushButton" name="btn_search">
<property name="geometry">
<rect>
<x>670</x>
<y>60</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>检索</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>341</width>
<height>131</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>检索客户信息:</string>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>-1</x>
<y>489</y>
<width>801</width>
<height>111</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_registers">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>新建客户</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_order">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>订房</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>781</width>
<height>341</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>

@ -1,14 +1,151 @@
#include "receptionist.h"
#include "ui_receptionist.h"
#include "cellstatus.h"
#include "checkbtn.h"
receptionist::receptionist(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::receptionist)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("宜客酒店");
this->setFixedSize(1920,1080);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/login.png"));
bg->lower();
// 设置主窗口大小为1920x1080
this->setFixedSize(1920,1080);
db = QSqlDatabase::addDatabase("QMYSQL");
db.setDatabaseName("hotel");
db.setHostName("localhost");
db.setPort(3306);
db.setUserName("root");
db.setPassword("111111");
if(db.open()){
qDebug("database connect succeed");
}else{
qDebug("database connect failed");
}
// 创建 QTableWidget 和其他组件
ui->tableWidget->setRowCount(3);
ui->tableWidget->setColumnCount(8);
ui->tableWidget->verticalHeader()->setVisible(false);
ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态","退房时间","客户信息","操作"});
ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->tableWidget->setStyleSheet("QTableWidget{border:2px groove gray;border-radius:15px;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);}");
showall();
}
receptionist::~receptionist()
{
delete ui;
}
void receptionist::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
bg->resize(ui->widget->size());
}
void receptionist::showall(){
QSqlQuery query;
query.exec("select * from room");
ui->tableWidget->setRowCount(query.size());
int i = 0;
if(query.exec()){
while(query.next()){
//数据
for(int j = 0;j<6;j++){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(i,j,twi);
ui->tableWidget->setColumnWidth(j,259);
}
cellstatus* cell = new cellstatus();
connect(cell,&cellstatus::flash,this,&receptionist::onflash);
cell->setDB(db);
cell->setroomNum(query.value(0).toInt());
checkbtn* cbtn = new checkbtn;
cbtn->setroomNum(query.value(0).toInt());
cbtn->setDB(db);
cell->setcbtn(cbtn);
if(QString::compare(ui->tableWidget->model()->index(i,4).data().toString(),"使用")==0){
cell->setisused(true);
cbtn->setisused(true);
}else{
cell->setisused(false);
cbtn->setisused(false);
}
cell->setbtn();
cbtn->setbtn();
ui->tableWidget->setCellWidget(i,7,cell);
ui->tableWidget->setCellWidget(i,6,cbtn);
i++;
}
}
}
void receptionist::search(QString str){
int s = str.toInt();
ui->tableWidget->setRowCount(1);
ui->tableWidget->clear();
ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态","退房时间","客户信息","操作"});
QSqlQuery query;
query.prepare("select * from room where room_num like :str;");
query.bindValue(":str",s);
if(query.exec()){
while (query.next()){
for(int j = 0;j<6;j++){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(0,j,twi);
ui->tableWidget->setColumnWidth(j,259);
}
cellstatus* cell = new cellstatus();
connect(cell,&cellstatus::flash,this,&receptionist::onflash);
cell->setDB(db);
cell->setroomNum(query.value(0).toInt());
checkbtn* cbtn = new checkbtn;
cbtn->setroomNum(query.value(0).toInt());
cbtn->setDB(db);
cell->setcbtn(cbtn);
if(QString::compare(ui->tableWidget->model()->index(0,4).data().toString(),"使用")==0){
cell->setisused(true);
cbtn->setisused(true);
}else{
cell->setisused(false);
cbtn->setisused(false);
}
cell->setbtn();
cbtn->setbtn();
ui->tableWidget->setCellWidget(0,7,cell);
ui->tableWidget->setCellWidget(0,6,cbtn);
}
}
}
void receptionist::on_pushButton_clicked()
{
QString str = ui->lineEdit->text();
if(str == NULL){
showall();
}else{
search(str);
}
}
void receptionist::onflash(){
showall();
}

@ -2,6 +2,16 @@
#define RECEPTIONIST_H
#include <QMainWindow>
#include <QPushButton>
#include <QPainter>
#include <QTextCodec>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QLabel>
#include <QTableWidgetItem>
#include <QVBoxLayout> // 添加这一行
namespace Ui {
class receptionist;
@ -17,6 +27,16 @@ public:
private:
Ui::receptionist *ui;
QLabel *bg;
QSqlDatabase db;
void search(QString str);
void showall();
protected:
void paintEvent(QPaintEvent *e);
private slots:
void on_pushButton_clicked();
void onflash();
};
#endif // RECEPTIONIST_H

@ -6,10 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>1920</width>
<height>1080</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>1920</width>
<height>1080</height>
</size>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
@ -23,6 +29,106 @@
<height>1080</height>
</rect>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>1211</width>
<height>201</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>70</pointsize>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(85, 255, 255);</string>
</property>
<property name="text">
<string>宜客酒店</string>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>220</y>
<width>1861</width>
<height>831</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>1230</x>
<y>110</y>
<width>411</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>25</pointsize>
</font>
</property>
<property name="text">
<string>房间检索:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>1470</x>
<y>130</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border-radius:15px;</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>1809</x>
<y>127</y>
<width>81</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>查找</string>
</property>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
@ -30,7 +136,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>1920</width>
<height>17</height>
</rect>
</property>

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

@ -0,0 +1,201 @@
#include "registers.h"
#include "ui_registers.h"
registers::registers(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::registers)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
setWindowTitle("宜客酒店");
this->setFixedSize(800,600);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/register.jpg"));
bg->lower();
ui->lineEdit_password->setEchoMode(QLineEdit::Password);
ui->lineEdit_password_r->setEchoMode(QLineEdit::Password);
ui->radioButton_M->setChecked(1);
db = QSqlDatabase::addDatabase("QMYSQL");
db.setDatabaseName("hotel");
db.setHostName("localhost");
db.setPort(3306);
db.setUserName("root");
db.setPassword("111111");
if(db.open()){
qDebug("database connect succeed");
}else{
qDebug("database connect failed");
}
}
registers::~registers()
{
delete ui;
}
void registers::paintEvent(QPaintEvent*)
{
bg->resize(ui->widget->size());
if(type==2){
ui->label->setText("账号(工号)");
ui->label_4->hide();
ui->label_5->hide();
ui->label_6->hide();
ui->lineEdit_id->hide();
ui->lineEdit_name->hide();
ui->frame_2->hide();
}
}
void registers::settype(int i){
type = i;
}
bool registers::verify(int x){
if(type==1){
if(x==1){//账号(手机号)判别
if(ui->lineEdit_account->text().size()!=11){
return false;
}else{
QString str = ui->lineEdit_account->text();
for(int i=0;i<11;i++){
if(str.at(i)!='1'&&str.at(i)!='2'&&str.at(i)!='3'&&str.at(i)!='4'&&str.at(i)!='5'&&str.at(i)!='6'&&str.at(i)!='7'&&str.at(i)!='8'&&str.at(i)!='9'&&str.at(i)!='0'){
return false;
}
}
return true;
}
}else if(x==2){//密码判别
if(ui->lineEdit_password->text().size()<6||ui->lineEdit_password->text().size()>16){
return false;
}else{
QString str = ui->lineEdit_password->text();
int num = str.size();
for(int i=0;i<num;i++){
if(!(std::isalnum(str.at(i).unicode()))){
return false;
}
}
return true;
}
}else if(x==3){//密码二次输入判别
if(QString::compare(ui->lineEdit_password->text(),ui->lineEdit_password_r->text())==0){
return true;
}else{
return false;
}
}else if(x==4){//姓名判别
if(ui->lineEdit_name->text().size()>14||ui->lineEdit_name->text()==NULL){
return false;
}else{
return true;
}
}else if(x==5){//身份证号判别
if(ui->lineEdit_id->text().size()!=18){
return false;
}else{
QString str = ui->lineEdit_id->text();
int num = str.size();
for(int i=0;i<num;i++){
if(str.at(i)!='1'&&str.at(i)!='2'&&str.at(i)!='3'&&str.at(i)!='4'&&str.at(i)!='5'&&str.at(i)!='6'&&str.at(i)!='7'&&str.at(i)!='8'&&str.at(i)!='9'&&str.at(i)!='0'&&str.at(i)!='X'){
return false;
}
}
return true;
}
}else{
return false;
}
}else if(type == 2){
if(x==1){//账号(工号)判别
if(ui->lineEdit_account->text().size()!=12){
return false;
}else{
QString str = ui->lineEdit_account->text();
for(int i=0;i<12;i++){
if(str.at(i)!='1'&&str.at(i)!='2'&&str.at(i)!='3'&&str.at(i)!='4'&&str.at(i)!='5'&&str.at(i)!='6'&&str.at(i)!='7'&&str.at(i)!='8'&&str.at(i)!='9'&&str.at(i)!='0'){
return false;
}
}
return true;
}
}else if(x==2){//密码判别
if(ui->lineEdit_password->text().size()<6||ui->lineEdit_password->text().size()>16){
return false;
}else{
QString str = ui->lineEdit_password->text();
int num = str.size();
for(int i=0;i<num;i++){
if(!(std::isalnum(str.at(i).unicode()))){
return false;
}
}
return true;
}
}else if(x==3){//密码二次输入判别
if(QString::compare(ui->lineEdit_password->text(),ui->lineEdit_password_r->text())==0){
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
void registers::on_pushButton_clicked()
{
if(type== 1){
if(!verify(1)){
QMessageBox::warning(this, tr("提示"), tr("请检查账号是否符合规范,目前仅限中国大陆用户注册,手机号应为+86 11位号码"));
}else if(!verify(2)){
QMessageBox::warning(this, tr("提示"), tr("请检查密码是否符合规范密码应由6-16位字母或数字组成"));
}else if(!verify(3)){
QMessageBox::warning(this, tr("提示"), tr("两次输入密码不相同,请重新输入!"));
}else if(!verify(4)){
QMessageBox::warning(this, tr("提示"), tr("姓名字数为空或超出,请重新输入!"));
}else if(!verify(5)){
QMessageBox::warning(this, tr("提示"), tr("请检查身份证信息是否符合规范并重新输入!\n请注意X为大写字母"));
}else{
sign_in();
QMessageBox::information(this, tr("提示"), tr("注册成功!"));
this->hide();
}
}else{
if(!verify(1)){
QMessageBox::warning(this, tr("提示"), tr("请检查账号是否符合规范账号应为12位纯数字工号"));
}else if(!verify(2)){
QMessageBox::warning(this, tr("提示"), tr("请检查密码是否符合规范密码应由6-16位字母或数字组成"));
}else if(!verify(3)){
QMessageBox::warning(this, tr("提示"), tr("两次输入密码不相同,请重新输入!"));
}else{
sign_in();
QMessageBox::information(this, tr("提示"), tr("注册成功!"));
this->hide();
}
}
}
void registers::sign_in(){
if(type==1){
QString gender;
if(ui->radioButton_M->isChecked()){
gender = "";
}else{
gender = "";
}
QString sql = QString("INSERT INTO customer VALUES('%1','%2','%3','%4','%5',NULL);").arg(ui->lineEdit_account->text()).arg(ui->lineEdit_password->text()).arg(ui->lineEdit_name->text()).arg(gender).arg(ui->lineEdit_id->text());
QSqlQuery query;
query.exec(sql);
}else{
QString sql = QString("INSERT INTO employee VALUES('%1','%2');").arg(ui->lineEdit_account->text()).arg(ui->lineEdit_password->text());
QSqlQuery query;
query.exec(sql);
}
}

@ -0,0 +1,40 @@
#ifndef REGISTERS_H
#define REGISTERS_H
#include <QMainWindow>
#include <QLabel>
#include <QDebug>
#include <QString>
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlQuery>
namespace Ui {
class registers;
}
class registers : public QMainWindow
{
Q_OBJECT
public:
explicit registers(QWidget *parent = nullptr);
~registers();
void settype(int i);
protected:
void paintEvent(QPaintEvent*);
private slots:
void on_pushButton_clicked();
private:
bool verify(int x);
void sign_in();
Ui::registers *ui;
QLabel *bg;
QSqlDatabase db;
int type;
};
#endif // REGISTERS_H

@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>registers</class>
<widget class="QMainWindow" name="registers">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>700</width>
<height>400</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>确认密码:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>身份证:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>账号(手机号)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_password_r">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>密码:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_account">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_name">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>姓名:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_id">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_password">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>350</x>
<y>525</y>
<width>100</width>
<height>50</height>
</rect>
</property>
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>14</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>注册</string>
</property>
</widget>
<widget class="QFrame" name="frame_2">
<property name="geometry">
<rect>
<x>50</x>
<y>450</y>
<width>700</width>
<height>50</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<family>Microsoft YaHei UI</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>性别:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_M">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>男</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_F">
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>女</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>17</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

@ -1,9 +1,14 @@
<RCC>
<qresource prefix="/image/bg">
<file>login.png</file>
<file>sea.jpg</file>
<file>register.jpg</file>
<file>order.png</file>
<file>add.jpg</file>
</qresource>
<qresource prefix="/image/icon">
<file>info.png</file>
<file>logo.png</file>
<file>resetcode.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

@ -0,0 +1,131 @@
#include "resetmessage.h"
#include "QIcon"
#include "QLabel"
#include "ui_resetmessage.h"
ResetMessage::ResetMessage(QWidget *parent) :
QDialog(parent),
ui(new Ui::ResetMessage)
{
ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
setWindowTitle("宜客酒店");
this->setFixedSize(800,600);
QPalette q;//调色板
q.setBrush(QPalette::Window,QBrush(QPixmap("/image/bg/sea,jpg")));
this->setPalette(q);
ui->code->setEchoMode(QLineEdit::Password);
ui->confirm_code->setEchoMode(QLineEdit::Password);
ui->radioButton_man->setChecked(1);
db = QSqlDatabase::addDatabase("QMYSQL");
db.setDatabaseName("hotel");
db.setHostName("localhost");
db.setPort(3306);
db.setUserName("root");
db.setPassword("111111");
if(db.open()){
qDebug("database connect succeed");
}else{
qDebug("database connect failed");
}
}
ResetMessage::~ResetMessage()
{
delete ui;
}
bool ResetMessage::verify(int x){
if(x==2){//密码判别
if(ui->code->text().size()<6||ui->code->text().size()>16){
return false;
}else{
QString str = ui->code->text();
int num = str.size();
for(int i=0;i<num;i++){
if(!(std::isalnum(str.at(i).unicode()))){
return false;
}
}
return true;
}
}else if(x==3){//密码二次输入判别
if(QString::compare(ui->code->text(),ui->confirm_code->text())==0){
return true;
}else{
return false;
}
}else if(x==4){//姓名判别
if(ui->name->text().size()>14||ui->name->text()==NULL){
return false;
}else{
return true;
}
}else if(x==5){//身份证号判别
if(ui->ID_card->text().size()!=18){
return false;
}else{
QString str = ui->ID_card->text();
int num = str.size();
for(int i=0;i<num;i++){
if(str.at(i)!='1'&&str.at(i)!='2'&&str.at(i)!='3'&&str.at(i)!='4'&&str.at(i)!='5'&&str.at(i)!='6'&&str.at(i)!='7'&&str.at(i)!='8'&&str.at(i)!='9'&&str.at(i)!='0'&&str.at(i)!='X'){
return false;
}
}
return true;
}
}else{
return false;
}
}
void ResetMessage::on_pushButton_clicked()
{
if(!verify(2)){
QMessageBox::warning(this, tr("提示"), tr("请检查密码是否符合规范密码应由6-16位字母或数字组成"));
}else if(!verify(3)){
QMessageBox::warning(this, tr("提示"), tr("两次输入密码不相同,请重新输入!"));
}else if(!verify(4)){
QMessageBox::warning(this, tr("提示"), tr("姓名字数为空或超出,请重新输入!"));
}else if(!verify(5)){
QMessageBox::warning(this, tr("提示"), tr("请检查身份证信息是否符合规范并重新输入!\n请注意X为大写字母"));
}else{
sign_in();
QMessageBox::information(this, tr("提示"), tr("更新成功!"));
this->hide();
}
}
void ResetMessage::getid(QString str){
id = str;
}
void ResetMessage::sign_in(){
QString gender;
if(ui->radioButton_man->isChecked()){
gender = "";
}else{
gender = "";
}
QSqlQuery query;
query.prepare("UPDATE customer set password = :p where account = :a");
query.bindValue(":p",ui->code->text());
query.bindValue(":a",id);
query.exec();
query.prepare("UPDATE customer set name = :n where account = :a");
query.bindValue(":n",ui->name->text());
query.bindValue(":a",id);
query.exec();
query.prepare("UPDATE customer set gender = :g where account = :a");
query.bindValue(":g",gender);
query.bindValue(":a",id);
query.exec();
query.prepare("UPDATE customer set id = :id where account = :a");
query.bindValue(":id",ui->ID_card->text());
query.bindValue(":a",id);
query.exec();
}

@ -0,0 +1,39 @@
#ifndef RESETMESSAGE_H
#define RESETMESSAGE_H
#include <QMainWindow>
#include <QLabel>
#include <QDebug>
#include <QString>
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlQuery>
namespace Ui {
class ResetMessage;
}
class ResetMessage : public QDialog
{
Q_OBJECT
public:
explicit ResetMessage(QWidget *parent = nullptr);
~ResetMessage();
void getid(QString str);
protected:
private:
Ui::ResetMessage *ui;
bool verify(int x);
void sign_in();
QLabel *bg;
QSqlDatabase db;
QString id;
private slots:
void on_pushButton_clicked();
};
#endif // RESETMESSAGE_H

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ResetMessage</class>
<widget class="QDialog" name="ResetMessage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QLabel" name="label_code">
<property name="geometry">
<rect>
<x>150</x>
<y>70</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>新密码</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_confirm">
<property name="geometry">
<rect>
<x>150</x>
<y>160</y>
<width>111</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>确认密码</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_name">
<property name="geometry">
<rect>
<x>150</x>
<y>270</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>姓名</string>
</property>
</widget>
<widget class="QLabel" name="label_id">
<property name="geometry">
<rect>
<x>150</x>
<y>370</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>身份证</string>
</property>
</widget>
<widget class="QLineEdit" name="ID_card">
<property name="geometry">
<rect>
<x>300</x>
<y>370</y>
<width>400</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="code">
<property name="geometry">
<rect>
<x>300</x>
<y>70</y>
<width>400</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="confirm_code">
<property name="geometry">
<rect>
<x>300</x>
<y>170</y>
<width>400</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="name">
<property name="geometry">
<rect>
<x>300</x>
<y>270</y>
<width>400</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_gender">
<property name="geometry">
<rect>
<x>150</x>
<y>444</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>性别</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_man">
<property name="geometry">
<rect>
<x>300</x>
<y>444</y>
<width>79</width>
<height>19</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>男</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_woman">
<property name="geometry">
<rect>
<x>500</x>
<y>444</y>
<width>79</width>
<height>19</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 127);</string>
</property>
<property name="text">
<string>女</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>350</x>
<y>520</y>
<width>100</width>
<height>50</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>更新</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/image/bg/sea.jpg&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<zorder>label</zorder>
<zorder>label_code</zorder>
<zorder>label_confirm</zorder>
<zorder>label_name</zorder>
<zorder>label_id</zorder>
<zorder>ID_card</zorder>
<zorder>code</zorder>
<zorder>confirm_code</zorder>
<zorder>name</zorder>
<zorder>label_gender</zorder>
<zorder>radioButton_man</zorder>
<zorder>radioButton_woman</zorder>
<zorder>pushButton</zorder>
</widget>
<resources/>
<connections/>
</ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Loading…
Cancel
Save