Пример #1
0
  public void updateAdvisorDetails(Advisor advisor, Advisorfirm advisorfirm) {
    Advisor persistentAdvisor = this.advisorDAO.findById(advisor.getId());

    persistentAdvisor.setAssistantname(advisor.getAssistantname());
    persistentAdvisor.setAssistantemail(advisor.getAssistantemail());

    Individual persistentIndividual = persistentAdvisor.getIndividual();
    Individual transientIndividual = advisor.getIndividual();

    persistentIndividual.setTitle(transientIndividual.getTitle());
    persistentIndividual.setFirstname(transientIndividual.getFirstname());
    persistentIndividual.setLastname(transientIndividual.getLastname());
    persistentIndividual.setWorkphone(transientIndividual.getWorkphone());
    persistentIndividual.setMobilephone(transientIndividual.getMobilephone());
    persistentIndividual.setWorkfax(transientIndividual.getWorkfax());
    persistentIndividual.setWorkemail(transientIndividual.getWorkemail());

    Company persistentAdvisorFirmCompany = persistentAdvisor.getAdvisorfirm().getCompany();
    Company tranientAdvisorFirmCompany = advisorfirm.getCompany();

    persistentAdvisorFirmCompany.setName(tranientAdvisorFirmCompany.getName());
    persistentAdvisorFirmCompany.setAbn(tranientAdvisorFirmCompany.getAbn());
    persistentAdvisorFirmCompany.setAddress1(tranientAdvisorFirmCompany.getAddress1());
    persistentAdvisorFirmCompany.setSuburb(tranientAdvisorFirmCompany.getSuburb());
    persistentAdvisorFirmCompany.setState(tranientAdvisorFirmCompany.getState());
    persistentAdvisorFirmCompany.setPostcode(tranientAdvisorFirmCompany.getPostcode());

    this.advisorDAO.updateAdvisorDetails(persistentAdvisor);
  }
Пример #2
0
  public Set<Application> getApplicationsToDisplay(Advisor advisor) {
    this.advisorDAO.refresh(advisor);

    Set<Application> filteredApplications =
        new TreeSet<Application>(
            new Comparator<Application>() {
              public int compare(Application o1, Application o2) {
                int res =
                    o1.getAccountdesignation().compareToIgnoreCase(o2.getAccountdesignation());

                // this is to see all applications even with the same acccount
                // designation.
                if (res == 0) {
                  res = new Long(o1.getId()).compareTo(o2.getId());
                }

                return res;
              }
            });

    Set<Application> applications = advisor.getApplications();
    for (Application application : applications) {
      if (application.getStatus() != Constants.CANCELLED_STATUS) {
        filteredApplications.add(application);
      }
    }

    return filteredApplications;
  }