From 956ecb0d86c93179fec5cb23ebc7ec308147f5de Mon Sep 17 00:00:00 2001 From: giomba Date: Sun, 20 Sep 2020 22:03:35 +0200 Subject: [PATCH] renewals added --- argento/EditWindow.cpp | 28 +- argento/EditWindow.h | 3 +- argento/EditWindow.ui | 613 ++++++++++++++++------------------------- 3 files changed, 271 insertions(+), 373 deletions(-) diff --git a/argento/EditWindow.cpp b/argento/EditWindow.cpp index 7502a39..882b307 100644 --- a/argento/EditWindow.cpp +++ b/argento/EditWindow.cpp @@ -1,7 +1,10 @@ #include "EditWindow.h" #include "ui_EditWindow.h" -EditWindow::EditWindow(int idSocio, QWidget* parent) : QMainWindow(parent), ui(new Ui::EditWindow) { +EditWindow::EditWindow(int idSocio, QWidget* parent) : + QDialog(parent), + ui(new Ui::EditWindow) +{ ui->setupUi(this); QSqlQuery query; @@ -79,6 +82,29 @@ void EditWindow::on_buttonAnnulla_clicked() { this->close(); } +void EditWindow::on_buttonRinnova_clicked() { + int ret = QMessageBox::information( + this, + "Rinnovo iscrizione socio", + QString("Confermando verrĂ  rinnovata l'iscrizione di %1 %2 per l'anno corrente. Confermi?") + .arg(ui->lineNome->text()) + .arg(ui->lineCognome->text()), + QMessageBox::Cancel | QMessageBox::Ok); + + if (ret == QMessageBox::Ok) { + qint64 id_socio = ui->lineID->text().toInt(); + QSqlQuery query; + query.prepare("INSERT INTO iscrizione (socio) VALUES (:socio)"); + query.bindValue(":socio", id_socio); + if (query.exec()) { + status(Ui::SUCCESS, "registration renewal successfull"); + } else { + status(Ui::ERROR, "registration renewal error: " + query.lastError().text()); + } + } + +} + EditWindow::~EditWindow() { delete mapper; diff --git a/argento/EditWindow.h b/argento/EditWindow.h index 6aa2f16..447d0a9 100644 --- a/argento/EditWindow.h +++ b/argento/EditWindow.h @@ -17,7 +17,7 @@ namespace Ui { class EditWindow; } -class EditWindow : public QMainWindow { +class EditWindow : public QDialog { Q_OBJECT public: @@ -27,6 +27,7 @@ public: private slots: void on_buttonSalva_clicked(); void on_buttonAnnulla_clicked(); + void on_buttonRinnova_clicked(); private: QSqlQuery query; diff --git a/argento/EditWindow.ui b/argento/EditWindow.ui index 16fb54b..c9080eb 100644 --- a/argento/EditWindow.ui +++ b/argento/EditWindow.ui @@ -1,387 +1,258 @@ EditWindow - + 0 0 - 652 - 273 + 422 + 609 - Edit Window + Modifica socio - - - - false - - - - 10 - 20 - 51 - 32 - - - - true - - - - - - 10 - 0 - 14 - 18 - - - - ID - - - - - - 70 - 0 - 38 - 18 - - - - Nome - - - - - - 360 - 0 - 60 - 18 - - - - Cognome - - - - - - 70 - 20 - 281 - 32 - - - - - - - - - - 360 - 20 - 281 - 32 - - - - - - - 120 - 80 - 231 - 32 - - - - - - - 360 - 80 - 281 - 32 - - - - - - - 10 - 60 - 92 - 18 - - - - Data di Nascita - - - true - - - - - - 120 - 60 - 132 - 18 - - - - Comune di Residenza - - - true - - - - - - 360 - 50 - 41 - 31 - - - - Email - - - true - - - - - - 10 - 110 - 71 - 21 - - - - Professione - - - true - - - - - - 330 - 110 - 41 - 21 - - - - Fonte - - - true - - - - - - 10 - 80 - 101 - 32 - - - - dd/MM/yyyy - - - true - - - - - - 10 - 130 - 311 - 32 - - - - - - - 330 - 130 - 311 - 32 - - - - - - - 10 - 210 - 631 - 16 - - - - Qt::Horizontal - - - - - - 550 - 230 - 91 - 34 - - - - Salva - - - - - - 450 - 170 - 71 - 31 - - - - Abilita - - - - - false - - - - 230 - 170 - 101 - 32 - - - - true - - - dd/MM/yyyy - - - true - - - - - - 10 - 170 - 80 - 31 - - - - Questionario - - - true - - - - - - 450 - 230 - 91 - 34 - - - - Annulla - - - - - - 100 - 170 - 131 - 31 - - - - Ultima compilazione - - - true - - - - - false - - - - 370 - 170 - 71 - 32 - - - - true - - - - - - 340 - 170 - 31 - 31 - - - - OTP - - - true - - - + + + + + + + Anagrafica + + + + + + + + ID + + + + + + + false + + + true + + + + + + + Nome + + + + + + + + + + + + + + Cognome + + + + + + + + + + Data di Nascita + + + true + + + + + + + dd/MM/yyyy + + + true + + + + + + + Comune di Residenza + + + true + + + + + + + + + + Email + + + true + + + + + + + + + + Professione + + + true + + + + + + + + + + Fonte + + + true + + + + + + + + + + + + + + + Questionario + + + + + + + + Ultima compilazione + + + true + + + + + + + false + + + true + + + dd/MM/yyyy + + + true + + + + + + + false + + + true + + + OTP + + + + + + + Abilita + + + + + + + + + + + + Operazioni + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Rinnova + + + + + + + Annulla + + + + + + + Salva + + + + + + + + + + + - - lineID - lineNome - lineCognome - dateDataNascita - lineComuneResidenza - lineEmail - comboProfessione - comboFonte - dateDataCompilazione - checkAbilitaQuestionario - buttonSalva -