From fc3e710d50f3a4b4865c8c287430972506a855ed Mon Sep 17 00:00:00 2001 From: zyx <1029606625@qq.com> Date: Wed, 6 Jul 2022 15:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E6=95=B4?= =?UTF-8?q?=E7=90=86=EF=BC=8Cbean=E5=AF=B9=E8=B1=A1=E8=BD=AC=E4=B8=BAh?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Course.h | 31 +++++++++++++++++++++++++++++++ CourseDAO.h | 2 +- Grade.cpp => Grade.h | 6 +++--- GradeDAO.h | 2 +- SAS.vcxproj | 6 +++--- SAS.vcxproj.filters | 18 +++++++++--------- Student.cpp => Student.h | 6 +++--- StudentDAO.h | 2 +- 8 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 Course.h rename Grade.cpp => Grade.h (92%) rename Student.cpp => Student.h (93%) diff --git a/Course.h b/Course.h new file mode 100644 index 0000000..dfe8583 --- /dev/null +++ b/Course.h @@ -0,0 +1,31 @@ +/* +* 课程表DAO +*/ +#ifndef COURSE_H +#define COURSE_H + +#include +using std::string; +class Course +{ +public: + Course() { ; } + Course(string id, string name) { + this->id = id; + this->name = name; + } + + string getId() { return id; } + void setId(string id) { this->id = id; } + string getName() { return name; } + void setName(string name) { this->name = name; } + + string toString() { + return id + "\t" + name; + } +private: + string id;//课程号 + string name;//课程名 +}; + +#endif // !COURSE_H \ No newline at end of file diff --git a/CourseDAO.h b/CourseDAO.h index 4354dbe..c05de6a 100644 --- a/CourseDAO.h +++ b/CourseDAO.h @@ -8,7 +8,7 @@ #include #include -#include"Course.cpp" +#include"Course.h" /* * 向数据库添加课程 diff --git a/Grade.cpp b/Grade.h similarity index 92% rename from Grade.cpp rename to Grade.h index eab0573..c7b2a99 100644 --- a/Grade.cpp +++ b/Grade.h @@ -1,8 +1,8 @@ /* * 成绩表DAO */ -#ifndef GRADE_CPP -#define GRADE_CPP +#ifndef GRADE_H +#define GRADE_H #include using std::string; @@ -33,4 +33,4 @@ private: string grade;//成绩 }; -#endif // !GRADE_CPP \ No newline at end of file +#endif // !GRADE_H \ No newline at end of file diff --git a/GradeDAO.h b/GradeDAO.h index d1c08af..d775756 100644 --- a/GradeDAO.h +++ b/GradeDAO.h @@ -8,7 +8,7 @@ #include #include -#include"Grade.cpp" +#include"Grade.h" /* * 向数据库添加成绩 diff --git a/SAS.vcxproj b/SAS.vcxproj index a291431..542136c 100644 --- a/SAS.vcxproj +++ b/SAS.vcxproj @@ -127,25 +127,25 @@ - - - + + + diff --git a/SAS.vcxproj.filters b/SAS.vcxproj.filters index ae1039f..ad61ddc 100644 --- a/SAS.vcxproj.filters +++ b/SAS.vcxproj.filters @@ -18,15 +18,6 @@ 婧愭枃浠 - - 婧愭枃浠 - - - 婧愭枃浠 - - - 婧愭枃浠 - 婧愭枃浠 @@ -71,5 +62,14 @@ 澶存枃浠 + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + \ No newline at end of file diff --git a/Student.cpp b/Student.h similarity index 93% rename from Student.cpp rename to Student.h index bc9d0de..862ed0b 100644 --- a/Student.cpp +++ b/Student.h @@ -1,8 +1,8 @@ /* * 学生表DAO */ -#ifndef STUDENT_CPP -#define STUDENT_CPP +#ifndef STUDENT_H +#define STUDENT_H #include using std::string; @@ -39,4 +39,4 @@ private: string status;//状态(在读、休学、退学) }; -#endif // !STUDENT_CPP \ No newline at end of file +#endif // !STUDENT_H \ No newline at end of file diff --git a/StudentDAO.h b/StudentDAO.h index 7a884a6..1fbee6b 100644 --- a/StudentDAO.h +++ b/StudentDAO.h @@ -8,7 +8,7 @@ #include #include -#include"Student.cpp" +#include"Student.h" /* * 向数据库添加学生