コード例 #1
0
  public void setMember(IMemberDto member) {
    this.member = member;

    txtfieldFName.setText(member.getPrename());
    txtfieldLName.setText(member.getLastname());
    dateBirthday.setDate(member.getDateOfBirth());
    txtfieldPhone.setText(member.getTelephonenumber());
    txtfieldMail.setText(member.getEmailAddress());

    radioFemale.setSelected(member.getGender());
    radioMale.setSelected(!member.getGender());

    ICountryDto c = controller.getCountryById(member.getNationality());
    String countryName = c + "";
    txtfieldNationality.setText(countryName);

    this.addressPanel1.setAddress(controller.getById(member.getAddress()));
  }
コード例 #2
0
  public IMemberDto getMember() {
    if (member == null) {
      member = new MemberDto();
    }

    member.setPrename(txtfieldFName.getText());
    member.setLastname(txtfieldLName.getText());
    member.setDateOfBirth(dateBirthday.getDate());
    member.setTelephonenumber(txtfieldPhone.getText());
    member.setEmailAddress(txtfieldMail.getText());

    member.setGender(radioFemale.isSelected());
    member.setNationality(controller.getCountryByName(txtfieldNationality.getText()).getId());

    return member;
  }
コード例 #3
0
 @Override
 public void setCompetition(ICompetitionDto competition, IMemberDto member) {
   try {
     List<IDepartmentDto> departmentList = dtoFactory.getDepartmentMapper().getAll();
     for (IDepartmentDto dep : departmentList) {
       List<Integer> sportList = dep.getTypeOfSportList();
       for (Integer sportId : sportList) {
         if (sportId == competition.getSport()) {
           List<Integer> userRolesIds = member.getRoleList();
           for (Integer role : userRolesIds) {
             if (dtoFactory.getRoleMapper().getById(role).getId() == dep.getDepartmentHead()) {
               dtoFactory.getCompetitionMapper().set(competition);
             }
           }
         }
       }
     }
   } catch (RemoteException | IdNotFoundException | NotFoundException ex) {
     Logger.getLogger(NewCompetition.class.getName()).log(Level.SEVERE, null, ex);
   }
 }