You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
#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();
|
|
}
|
|
|