Пример #1
0
	bool Etudiant::check_person(Person &oPers) {
		bool bRet = DepartementPerson::check_person(oPers);
		std::string s1 = this->departementid();
		std::string s2 = this->personid();
		if (s1.empty() || s2.empty()) {
			return (bRet);
		}
		std::vector<PersonRole> oRoles = oPers.roles();
		PersonRole r(s1, DomainConstants::ROLE_ETUD);
		bool bFound = false;
		for (auto it = oRoles.begin(); it != oRoles.end(); ++it) {
			if ((*it) == r) {
				bFound = true;
				break;
			}
		}// it
		if (!bFound) {
			std::string depid = this->departementid();
			oPers.add_role(depid,DomainConstants::ROLE_ETUD);
			bRet = true;
		}
		return bRet;
	}