Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. public class ParticipantInfoOnBadge {
  2.     String participantId;
  3.     String participantEngFullName;
  4.     String participantChiFullName;
  5.     String engOrgName;
  6.     String chiOrgName;
  7.     String engOrgCountry;
  8.     String chiOrgCountry;
  9.     ParticipantInfoOnBadge(String participantId) {
  10.         loadInfoFromDB(participantId);
  11.     }
  12.     void loadInfoFromDB(String participantId) {
  13.         this.participantId = participantId;
  14.         getParticipantFullNames();
  15.         getOrgNameAndCountry();
  16.     }
  17.     void getParticipantFullNames() {
  18.         ParticipantsInDB partsInDB = ParticipantsInDB.getInstance();
  19.         Participant part = partsInDB.locateParticipant(participantId);
  20.         if (part != null) {
  21.             participantEngFullName = part.getEFullName();
  22.             participantChiFullName = part.getCFullName();
  23.         }
  24.     }
  25.     void getOrgNameAndCountry() {
  26.         OrganizationsInDB orgsInDB = OrganizationsInDB.getInstance();
  27.         String oid = orgsInDB.findOrganizationEmploying(participantId);
  28.         if (oid != null) {
  29.             Organization org = orgsInDB.locateOrganization(oid);
  30.             engOrgName = org.getEName();
  31.             chiOrgName = org.getCName();
  32.             engOrgCountry = org.getEAddress().getCountry();
  33.             chiOrgCountry = org.getCAddress().getCountry();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement