public boolean addMentorAndMentee(Boolean isHas, String mentorMailId) {
try {
Participant mentor = pm.findParticipantByEmail(mentorMailId);
Participant mentee = pm.findParticipantByEmail(getUserId());
if (isHas) {
PulseVO p = new PulseVO(mentee.getEmail(), mentee.getName(), mentee.getFacebookId(), mentee.getLoc().getLongitude(), mentee.getLoc().getLatitude(), mentee.getLoc().getLocationString(), State.mentee, mentor.getFacebookId());
boolean pulsestatus = createParticipantPulse(p);
boolean mentorstatus = pm.addMentorToMentee(mentor, mentee);
if(pulsestatus && mentorstatus) {
return true;
}
else {
return false;
}
} else {
PulseVO p = new PulseVO(mentee.getEmail(), mentee.getName(), mentee.getFacebookId(), mentee.getLoc().getLongitude(), mentee.getLoc().getLatitude(), mentee.getLoc().getLocationString(), State.mentor, mentor.getFacebookId());
boolean pulsestatus = createParticipantPulse(p);
boolean mentorstatus = pm.addMentorToMentee(mentee, mentor);
if(pulsestatus && mentorstatus) {
return true;
}