-
大小: 148KB文件類型: .zip金幣: 2下載: 1 次發(fā)布日期: 2021-06-13
- 語言: 數(shù)據(jù)庫
- 標(biāo)簽: qt??c++??
資源簡介
利用qt編程平臺,以及本地sqlite數(shù)據(jù)庫實(shí)現(xiàn)簡單的學(xué)生信息管理系統(tǒng),曾經(jīng)寫的,現(xiàn)在來看感覺很一般,需要下載的謹(jǐn)慎哦

代碼片段和文件信息
#include?“deletedialog.h“
#include?“ui_deletedialog.h“
#include?“mainwindow.h“
#include?
deleteDialog::deleteDialog(QWidget?*parent)?:
????QDialog(parent)
????ui(new?Ui::deleteDialog)
{
????ui->setupUi(this);
}
deleteDialog::~deleteDialog()
{
????delete?ui;
}
void?deleteDialog::on_delete_pushButton_clicked()
{
????if(ui->scanf_lineEdit->text().isEmpty())
????{
????????QMessageBox::information(this“提示““請輸入內(nèi)容“);
????}
????else
????{
????if(ui->studentname_radioButton->isChecked())
????{
????????QString?student_name;
????????student_name?=?ui->scanf_lineEdit->text();
????????QSqlQuery?query;
????????query.exec(“select?*?from?student“);
????????int?t?=0;
????????while(query.next())
????????{
????????????if(student_name?==?query.value(0).toString())
????????????{
????????????????t=?1;
????????????????break;
????????????}
????????}
????????if(t?==?1)
????????{
????????QString?delete_name?=?QString(“delete?from?student?where?StudentName?=?\“%1\““).arg(student_name);
????????qDebug()< ????????if(query.exec(delete_name))
????????{
????????????QMessageBox::information(this“成功““刪除成功“);
????????}
????????else
????????{
????????????QMessageBox::information(this“失敗““刪除失敗“);
????????}
????}
????????else
????????{
????????????QMessageBox::information(this“提示““不存在的姓名“);
????????}
????}
????else?if(ui->studentnumber_radioButton->isChecked())
????{
????????QString?student_number;
????????student_number?=?ui->scanf_lineEdit->text();
????????QSqlQuery?query;
????????query.exec(“select?*?from?student“);
????????int?t?=0;
????????while(query.next())
????????{
????????????if(student_number?==?query.value(1).toString())
????????????{
????????????????t=?1;
????????????????break;
????????????}
????????}
????????if(?t==?1)
????????{
????????QString?delete_student?=?QString(“delete?from?student?where?StudentNumber?=?\“%1\““).arg(student_number);
????????if(query.exec(delete_student))
????????{
????????????QMessageBox::information(this“成功““刪除成功“);
????????}
????????else
????????????QMessageBox::information(this“失敗““刪除失敗“);
????}
????????else
????????{
????????????QMessageBox::information(this“提示““不存在的學(xué)號“);
????????}
????}
????else
????{
????????QMessageBox::information(this“提示““請選擇姓名或?qū)W號“);
????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-25?01:00??DD\
?????文件???????38999??2018-08-25?00:56??DD\1.png
?????文件???????27221??2018-08-25?00:58??DD\2.png
?????文件???????22814??2018-08-25?00:58??DD\3.png
?????文件???????20826??2018-08-25?00:59??DD\4.png
?????文件???????29272??2018-08-25?01:00??DD\5.png
?????目錄???????????0??2018-08-25?01:00??DD\StdMgsystem\
?????文件????????2465??2018-07-08?20:40??DD\StdMgsystem\deletedialog.cpp
?????文件?????????381??2018-07-08?16:02??DD\StdMgsystem\deletedialog.h
?????文件????????1694??2018-07-08?21:07??DD\StdMgsystem\deletedialog.ui
?????文件????????1831??2018-07-08?20:58??DD\StdMgsystem\insertdialog.cpp
?????文件?????????381??2018-07-08?16:51??DD\StdMgsystem\insertdialog.h
?????文件????????2308??2018-07-08?21:07??DD\StdMgsystem\insertdialog.ui
?????文件?????????183??2018-07-07?17:42??DD\StdMgsystem\main.cpp
?????文件????????2523??2018-07-10?23:54??DD\StdMgsystem\mainwindow.cpp
?????文件????????1039??2018-07-08?16:51??DD\StdMgsystem\mainwindow.h
?????文件????????3661??2018-07-08?22:02??DD\StdMgsystem\mainwindow.ui
?????文件????????3792??2018-07-11?01:14??DD\StdMgsystem\selectdialog.cpp
?????文件?????????418??2018-07-08?18:31??DD\StdMgsystem\selectdialog.h
?????文件????????2869??2018-07-08?21:15??DD\StdMgsystem\selectdialog.ui
?????文件?????????664??2018-07-08?04:06??DD\StdMgsystem\StdMgsystem.pro
?????文件???????18532??2018-08-25?00:53??DD\StdMgsystem\StdMgsystem.pro.user
?????文件????????2948??2018-07-08?20:10??DD\StdMgsystem\updatedialog.cpp
?????文件?????????424??2018-07-08?19:46??DD\StdMgsystem\updatedialog.h
?????文件????????3574??2018-07-08?21:07??DD\StdMgsystem\updatedialog.ui
- 上一篇:mysql5.6配套正確安裝視頻
- 下一篇:linux聊天室即時通訊
評論
共有 條評論