-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Request class and started implementation of Inscrição de Aluno
- Loading branch information
Showing
9 changed files
with
171 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "Student.h" | ||
#include "Schedule.h" | ||
|
||
struct studComp | ||
{ | ||
bool operator()(const Student* s1, const Student* s2) const { return s1->getCode() < s2->getCode();} | ||
}; | ||
struct schedComp | ||
{ | ||
bool operator()(const Schedule* s1, const Schedule* s2) const { | ||
return s1->getClass() < s2->getClass(); | ||
} | ||
}; | ||
|
||
struct studentByName | ||
{ | ||
bool operator()(const Student* s1, const Student* s2) const { | ||
if (s1->getName() == s2->getName()) | ||
return s1->getCode() < s2->getCode(); | ||
return s1->getName() < s2->getName(); | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,45 @@ | ||
// | ||
// Created by luis on 18-10-2022. | ||
// | ||
|
||
#include "Request.h" | ||
|
||
Request::Request(unsigned int studentCode1, const vector<Turma> &newClasses) { | ||
this->studentCode1 = studentCode1; | ||
this->new_classes = newClasses; | ||
|
||
} | ||
|
||
Request::Request(unsigned int studentCode1, string studentName, const vector<Turma> &newClasses) { | ||
this->studentCode1 = studentCode1; | ||
this->studentName = studentName; | ||
this->new_classes = newClasses; | ||
} | ||
|
||
Request::Request(unsigned int studentCode1, unsigned int studentCode2, const vector<Turma> &newClasses) { | ||
this->studentCode1 = studentCode1; | ||
this->studentCode2 = studentCode2; | ||
this->new_classes = newClasses; | ||
} | ||
|
||
unsigned int Request::getStudentCode1() const { | ||
return studentCode1; | ||
} | ||
|
||
void Request::setStudentCode1(unsigned int studentCode1) { | ||
Request::studentCode1 = studentCode1; | ||
} | ||
|
||
unsigned int Request::getStudentCode2() const { | ||
return studentCode2; | ||
} | ||
|
||
void Request::setStudentCode2(unsigned int studentCode2) { | ||
Request::studentCode2 = studentCode2; | ||
} | ||
|
||
const vector<Turma> &Request::getNewClasses() const { | ||
return new_classes; | ||
} | ||
|
||
void Request::setNewClasses(const vector<Turma> &newClasses) { | ||
new_classes = newClasses; | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,7 +1,32 @@ | ||
#pragma once | ||
|
||
#include "Turma.h" | ||
#include "Student.h" | ||
|
||
class Request { | ||
public: | ||
Request(unsigned int studentCode1, const vector<Turma> &newClasses); | ||
|
||
Request(unsigned int studentCode1, string studentName, const vector<Turma> &newClasses); | ||
|
||
Request(unsigned int studentCode1, unsigned int studentCode2, const vector<Turma> &newClasses); | ||
|
||
unsigned int getStudentCode1() const; | ||
|
||
void setStudentCode1(unsigned int studentCode1); | ||
|
||
unsigned int getStudentCode2() const; | ||
|
||
void setStudentCode2(unsigned int studentCode2); | ||
|
||
const vector<Turma> &getNewClasses() const; | ||
|
||
void setNewClasses(const vector<Turma> &newClasses); | ||
|
||
private: | ||
unsigned int studentCode1; | ||
string studentName; // in case the student is being registered for the first time | ||
unsigned int studentCode2 = 0; | ||
vector<Turma> new_classes; | ||
|
||
}; | ||
|
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