diff --git a/LibManageSystem_Sever/addbook.cpp b/LibManageSystem_Sever/addbook.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41e2d0f54c4afd8bc4a63a97ac5ab974606177ee --- /dev/null +++ b/LibManageSystem_Sever/addbook.cpp @@ -0,0 +1,103 @@ +#include "addbook.h" +#include "ui_addbook.h" +#include +#include +addbook::addbook(Operat* _db,QWidget *parent) : + QMainWindow(parent),ui(new Ui::addbook), + db(_db) +{ + ui->setupUi(this); + ui->pushButton->setStyleSheet( //正常状态样式 + "QPushButton{" + "background-color:#67a6f8;"//设置按钮背景色 + "border-radius:6px;"//设置圆角半径 + "color:white;"//设置按钮字体颜色 + "}" + ); + QRegularExpression regExp1("[0-9-]+"); + ui->datelEdit->setValidator(new QRegularExpressionValidator(regExp1,this)); + QRegularExpression regExp2("[0-9]+"); + ui->numlEdit->setValidator(new QRegularExpressionValidator(regExp2,this)); + QRegularExpression regExp3("[0-9.]+"); + ui->pricelEdit->setValidator(new QRegularExpressionValidator(regExp3,this)); + ui->isbncodelEdit->setValidator(new QRegularExpressionValidator(regExp2,this)); +} + +addbook::~addbook() +{ + delete ui; +} + +void addbook::removeTEXT() +{ + ui->namelEdit->clear(); + ui->authorlEdit->clear(); + ui->presslEdit->clear(); + ui->datelEdit->clear(); + ui->isbncodelEdit->clear(); + ui->textEdit->clear(); + ui->numlEdit->clear(); + ui->comboBox->setCurrentIndex(0); + ui->pricelEdit->clear(); +} + +void addbook::on_pushButton_clicked() +{ + QString Name=ui->namelEdit->text().trimmed(); + QString Author=ui->authorlEdit->text().trimmed(); + QString Press=ui->presslEdit->text().trimmed(); + QString Printdate=ui->datelEdit->text().trimmed(); + QString Isbn_code=ui->isbncodelEdit->text().trimmed(); + QString Description=ui->textEdit->toPlainText().trimmed(); + QString Num=ui->numlEdit->text().trimmed(); + QString k; + if(ui->comboBox->currentIndex()==0) + { + k=""; + } + else k=ui->comboBox->currentText(); + QString Type=k; + QString Price=ui->pricelEdit->text().trimmed(); + if(!Name.isEmpty()&&!Author.isEmpty()&&!Press.isEmpty()&&!Printdate.isEmpty()&&!Isbn_code.isEmpty()&&!Description.isEmpty()&&!Num.isEmpty()&&!Type.isEmpty()&&!Price.isEmpty()) + { + bool flag=db->addbook(Name,Author,Press,Printdate,Isbn_code,Description,Num,Type,Price); + if(flag==true) + { + QMessageBox::information(this,"提示","添加成功"); + removeTEXT(); + } + else + { + int ret=QMessageBox::question(NULL,"警告","图书馆中已经有该书,是否要前往删改书籍页面?",QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes); + switch(ret) + { + case QMessageBox::Yes: + emit ToEditWidget(); + break; + default: break; + } + } + + } + else QMessageBox::warning(this,"警告","请输入书籍的完整信息"); +} + +void addbook::on_returnBtn_clicked() +{ + emit RetMagWidget(); +} + + +void addbook::on_presslEdit_textChanged(const QString &arg1) +{ + //自动补全选项 + QStringMatcher str("出版社"); + if(str.indexIn(arg1,0) == -1){ + QStringList complete_list; + QCompleter* complete_line; + complete_list << arg1 + "出版社"; + complete_line = new QCompleter(complete_list); + ui->presslEdit->setCompleter(complete_line); + } +} + diff --git a/LibManagementSystem/clientRes/icons8-chat-message-100.png b/LibManagementSystem/clientRes/icons8-chat-message-100.png new file mode 100644 index 0000000000000000000000000000000000000000..060eb3739ead7c69583c94ba750e30313b39d812 Binary files /dev/null and b/LibManagementSystem/clientRes/icons8-chat-message-100.png differ diff --git a/LibManagementSystem/clientRes/icons8-user-64.png b/LibManagementSystem/clientRes/icons8-user-64.png new file mode 100644 index 0000000000000000000000000000000000000000..83cb52a6bcb9fd3d2a550a647109b67d58cf55b2 Binary files /dev/null and b/LibManagementSystem/clientRes/icons8-user-64.png differ diff --git a/LibManagementSystem/clientResources.qrc b/LibManagementSystem/clientResources.qrc index 27458dbbb29d5e9f097a64cedc410b96293b6e38..ec7b08a5d19d0bd9850c6fc499fdfb8b13ef60e0 100644 --- a/LibManagementSystem/clientResources.qrc +++ b/LibManagementSystem/clientResources.qrc @@ -4,5 +4,7 @@ clientRes/LibIcon.png clientRes/MainBackGround.png clientRes/education-book.png + clientRes/icons8-user-64.png + clientRes/icons8-chat-message-100.png diff --git a/LibManagementSystem/infoedit.ui b/LibManagementSystem/infoedit.ui index 55ee44fffe6d6ea73db9aac6d89152e989e698a2..c5137b6ca74b61994b56ee6b4c79f451c4570e68 100644 --- a/LibManagementSystem/infoedit.ui +++ b/LibManagementSystem/infoedit.ui @@ -10,6 +10,9 @@ 392 + + WaitCursor + Form @@ -223,6 +226,9 @@ color:#67a6f8; 13 + + PointingHandCursor + color: rgb(1, 53, 174); border:none; diff --git a/LibManagementSystem/login.cpp b/LibManagementSystem/login.cpp index 6f9f047e398de5d419dcd56f3f316249c96254ae..00b952abfb178b26186d1888447ea28aa79c32bd 100644 --- a/LibManagementSystem/login.cpp +++ b/LibManagementSystem/login.cpp @@ -57,6 +57,7 @@ void login::fail_login(QString failmsg) box->setText(failmsg); box->show(); box->setAttribute(Qt::WA_DeleteOnClose); +// qDebug() << "登陆失败"; } void login::receive_login() @@ -64,6 +65,7 @@ void login::receive_login() ui->accountlineEdit->clear(); ui->passwordlineEdit->clear(); emit open_main(); +// qDebug() << "登陆成功"; } void login::fail_regis(QString failmsg) diff --git a/LibManagementSystem/mainwidget.ui b/LibManagementSystem/mainwidget.ui index 3409aa608a8de2ce4773eaf92bbdc377b094baec..87a81bbfafc2d658d9eb8103ed0b6c4b6d578a84 100644 --- a/LibManagementSystem/mainwidget.ui +++ b/LibManagementSystem/mainwidget.ui @@ -22,6 +22,9 @@ Form + + + #mainwidget{ background-image: url(:/images/clientRes/MainBackGround.png); @@ -132,9 +135,9 @@ QPushButton:hover{ - 560 - 4 - 141 + 10 + 0 + 41 41 @@ -147,9 +150,25 @@ QPushButton:hover{ PointingHandCursor - + 个人中心 + + + + + + + + + :/images/clientRes/icons8-user-64.png:/images/clientRes/icons8-user-64.png + + + + 35 + 35 + + false @@ -210,6 +229,8 @@ border-color:"transparent" - + + + diff --git a/LibManagementSystem/regis.ui b/LibManagementSystem/regis.ui index 7b48d86e2c59b8d4b78db27c8110b6b6cace9e80..9fb441cd8a70472b1670b1abd89bec23317912a4 100644 --- a/LibManagementSystem/regis.ui +++ b/LibManagementSystem/regis.ui @@ -327,6 +327,9 @@ color:#67a6f8; 13 + + PointingHandCursor + color: rgb(1, 53, 174); border:none; diff --git a/LibManagementSystem/user_info.cpp b/LibManagementSystem/user_info.cpp index 9c7e0e458612ef393b08600e42395285726d9ce5..e3d6b6513a56fdde5d4d7a2474d7031549816ac6 100644 --- a/LibManagementSystem/user_info.cpp +++ b/LibManagementSystem/user_info.cpp @@ -130,24 +130,6 @@ void user_info::on_infoEdit_clicked() fillInfo(); } -void user_info::on_commandLinkButton_clicked() -{ - if(user->message != "无"){ - QMessageBox* box = new QMessageBox(this); - box->setIcon(QMessageBox::Information); - box->setWindowTitle("消息"); - box->setText(user->message); - box->show(); - } - else{ - QMessageBox* box = new QMessageBox(this); - box->setIcon(QMessageBox::Information); - box->setWindowTitle("消息"); - box->setText("当前无消息!"); - box->show(); - } -} - void user_info::edit_confirm(QByteArray msg) { emit send_editInfo(msg); @@ -239,3 +221,22 @@ void user_info::receive_cancel() user->appointedbook = ""; fillInfo(); } + +void user_info::on_pushButton_clicked() +{ + if(user->message != ""){ + QMessageBox* box = new QMessageBox(this); + box->setIcon(QMessageBox::Information); + box->setWindowTitle("消息"); + box->setText(user->message); + box->show(); + } + else{ + QMessageBox* box = new QMessageBox(this); + box->setIcon(QMessageBox::Information); + box->setWindowTitle("消息"); + box->setText("当前无消息!"); + box->show(); + } +} + diff --git a/LibManagementSystem/user_info.h b/LibManagementSystem/user_info.h index dc880136951aad424354800739da8c44018ccc93..c7a7e42821ab923034b4874d90799a8d987b6898 100644 --- a/LibManagementSystem/user_info.h +++ b/LibManagementSystem/user_info.h @@ -40,8 +40,6 @@ private slots: void on_infoEdit_clicked(); - void on_commandLinkButton_clicked(); - void edit_confirm(QByteArray); void on_exit_clicked(); @@ -50,6 +48,8 @@ private slots: void on_cancekApp_clicked(); + void on_pushButton_clicked(); + public slots: void fail_editInfo(QString); diff --git a/LibManagementSystem/user_info.ui b/LibManagementSystem/user_info.ui index aa7fe5cd9c7358a90c14351aba9959d58915106c..e2403f327f6b8efc306934e8f3f9dd3098c3c86a 100644 --- a/LibManagementSystem/user_info.ui +++ b/LibManagementSystem/user_info.ui @@ -424,28 +424,6 @@ background-color:"transparent"; 书籍信息: - - - - 640 - 0 - 141 - 41 - - - - - Segoe UI - 12 - - - - PointingHandCursor - - - 我的消息 - - @@ -533,6 +511,43 @@ color:#67a6f8; × 取消预约书籍 + + + + 670 + 6 + 131 + 41 + + + + + 11 + + + + PointingHandCursor + + + color: rgb(255, 255, 255); + + + 我的消息 + + + + :/images/clientRes/icons8-chat-message-100.png:/images/clientRes/icons8-chat-message-100.png + + + + 20 + 20 + + + + true + + infoEdit return_2 sex @@ -550,11 +565,13 @@ color:#67a6f8; phone book_view app_book_2 - commandLinkButton exit cancekApp + pushButton - + + +