-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3eaa55
commit 8bf54a2
Showing
12 changed files
with
187 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "modifygradewidget.h" | ||
#include "ui_modifygradewidget.h" | ||
|
||
ModifyGradeWidget::ModifyGradeWidget(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::ModifyGradeWidget) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
ModifyGradeWidget::~ModifyGradeWidget() | ||
{ | ||
delete ui; | ||
} | ||
|
||
|
||
void ModifyGradeWidget::setMsg(QString name,QStringList cnos){ | ||
_name=name; | ||
_cnos=cnos; | ||
} | ||
|
||
void ModifyGradeWidget::on_toolButton_clicked() | ||
{ | ||
QString grade=ui->lineEdit->text(); | ||
QString res; | ||
QSqlQuery query; | ||
for(int i=0;i<_cnos.size();i++){ | ||
query.exec("update Stu_Cour set Grade="+grade+" where Sno='"+_cnos.at(i)+"' and Cno=(select Cno from CourseBasic where Cname='"+_name+"')"); | ||
if(query.lastError().type()!=QSqlError::NoError) res+=query.lastError().text(); | ||
} | ||
if(res==""){ | ||
QMessageBox::information(this,"修改成绩","修改成绩成功!"); | ||
this->close(); | ||
}else{ | ||
QMessageBox::warning(this,"修改成绩错误",res); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef MODIFYGRADEWIDGET_H | ||
#define MODIFYGRADEWIDGET_H | ||
|
||
#include <QWidget> | ||
#include<adminwindow.h> | ||
|
||
namespace Ui { | ||
class ModifyGradeWidget; | ||
} | ||
|
||
class ModifyGradeWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ModifyGradeWidget(QWidget *parent = nullptr); | ||
~ModifyGradeWidget(); | ||
|
||
void setMsg(QString name,QStringList cnos); | ||
|
||
private slots: | ||
void on_toolButton_clicked(); | ||
|
||
private: | ||
Ui::ModifyGradeWidget *ui; | ||
|
||
QString _name; | ||
QStringList _cnos; | ||
}; | ||
|
||
#endif // MODIFYGRADEWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ModifyGradeWidget</class> | ||
<widget class="QWidget" name="ModifyGradeWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>198</width> | ||
<height>93</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>修改成绩</string> | ||
</property> | ||
<property name="windowIcon"> | ||
<iconset resource="SIMS_res.qrc"> | ||
<normaloff>:/SIM_System_Pics/resources/icon_login_2.png</normaloff>:/SIM_System_Pics/resources/icon_login_2.png</iconset> | ||
</property> | ||
<widget class="QLineEdit" name="lineEdit"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>20</y> | ||
<width>161</width> | ||
<height>23</height> | ||
</rect> | ||
</property> | ||
<property name="placeholderText"> | ||
<string>成绩</string> | ||
</property> | ||
</widget> | ||
<widget class="QToolButton" name="toolButton"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>70</x> | ||
<y>60</y> | ||
<width>47</width> | ||
<height>22</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>确定</string> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources> | ||
<include location="SIMS_res.qrc"/> | ||
</resources> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters