-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapplyscholarwidget.cpp
More file actions
40 lines (34 loc) · 1008 Bytes
/
applyscholarwidget.cpp
File metadata and controls
40 lines (34 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "applyscholarwidget.h"
#include "ui_applyscholarwidget.h"
ApplyScholarWidget::ApplyScholarWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::ApplyScholarWidget)
{
ui->setupUi(this);
}
ApplyScholarWidget::~ApplyScholarWidget()
{
delete ui;
}
void ApplyScholarWidget::on_QuitButton_clicked()
{
this->close();
}
void ApplyScholarWidget::setMsg(QString scholar_){
this->scholar=scholar_;
ui->NameEdit->setText(scholar);
}
void ApplyScholarWidget::on_ConfirmButton_clicked()
{
Data *data=Data::getData();
QString sno=data->sno;
QString reason=ui->textEdit->toPlainText();
QSqlQuery query;
query.exec("insert into ScholarAppli values('"+sno+"','"+scholar+"','"+reason+"','3')");
if(query.lastError().type()==QSqlError::NoError){
QMessageBox::information(this,"申请奖学金","申请奖学金成功!");
this->close();
}else{
QMessageBox::warning(this,"申请奖学金错误",query.lastError().text());
}
}