Package de.xanders.data.customer.vo

Examples of de.xanders.data.customer.vo.OpportunityVO


     * @see OpportunityService#getOpportunityById(java.lang.Long)
     */
    protected OpportunityVO handleGetOpportunityById(java.lang.Long opportunityId)
        throws java.lang.Exception {
      Opportunity opportunity = this.getOpportunityDao().load(opportunityId);
      OpportunityVO opportunityVO = this.getOpportunityDao().toOpportunityVO(opportunity);
      CustAccountService custAccountService = DataServiceLocator.instance().getCustAccountService();
      opportunityVO.setCustAccountVO(custAccountService.toCustAccountVO(opportunity.getCustAccount()));
      return opportunityVO;           
    }
View Full Code Here


      List list = new ArrayList();
        Collection opportunityCollection = this.getOpportunityDao().findByCriteria(opportunityCriteria);
        Iterator iterator = opportunityCollection.iterator();
        while (iterator.hasNext()) {
          Opportunity opportunity = (Opportunity) iterator.next();
          OpportunityVO opportunityVO = this.getOpportunityDao().toOpportunityVO(opportunity);
          CustAccountService custAccountService = DataServiceLocator.instance().getCustAccountService();
          opportunityVO.setCustAccountVO(custAccountService.toCustAccountVO(opportunity.getCustAccount()));
          list.add(opportunityVO);
        }
        return list;                     
    }
View Full Code Here

    }

    protected void sort(final String column, final boolean ascending) {
      Comparator comparator = new Comparator() {
          public int compare(Object o1, Object o2) {
              OpportunityVO c1 = (OpportunityVO) o1;
              OpportunityVO c2 = (OpportunityVO) o2;

              if (column == null) {
                  return 0;
              }

              if (column.equals("custAccountId")) {
                  return ascending
                  ? c1.getCustAccountVO().getCustAccountId().compareTo(
                      c2.getCustAccountVO().getCustAccountId())
                  : c2.getCustAccountVO().getCustAccountId().compareTo(
                      c1.getCustAccountVO().getCustAccountId());
              } else if (column.equals("expiresOn")) {
                  return ascending
                  ? c1.getExpiresOn().compareTo(c2.getExpiresOn())
                  : c2.getExpiresOn().compareTo(c1.getExpiresOn());
              } else {
                  return 0;
              }
          }
      };
View Full Code Here

     *
   * Prepares to enter a new opportunity entry
   */
  public String initOpportunity() throws Exception {
        opportunityDetailForm = (OpportunityDetailForm) getForm(OPPORTUNITY_DETAIL_FORM);
        CustomerMapperFactory.getOpportunityMapper().mapToBean(new OpportunityVO(), opportunityDetailForm);
    return "opportunityDetail";
  }
View Full Code Here

   */
  public String saveOpportunity() throws Exception {
        opportunityDetailForm = (OpportunityDetailForm) getForm(OPPORTUNITY_DETAIL_FORM);
    if (validateBeanProperties(opportunityDetailForm)) {
      try {
        opportunityVO = new OpportunityVO();
        CustomerMapperFactory.getOpportunityMapper().mapToObj(opportunityDetailForm, opportunityVO);
                UserVO loggedInUserVO = (UserVO)getSession().getAttribute(Constants.LOGGED_IN_USER);
                if (opportunityVO.getOpportunityId() == null) {
                    opportunityVO.setCreatedOn(new Date());
                    opportunityVO.setCreatedBy(loggedInUserVO.getUserIdent());
View Full Code Here

  public String deleteOpportunity() throws Exception {
        opportunityDetailForm = (OpportunityDetailForm) getForm(OPPORTUNITY_DETAIL_FORM);
    try {
      dataServiceLocator.getOpportunityService().deleteOpportunity(
          new Long(opportunityDetailForm.getOpportunityId()));
      CustomerMapperFactory.getOpportunityMapper().mapToBean(new OpportunityVO(), opportunityDetailForm);
    } catch (OpportunityServiceException ex) {
      logger.error("DAO exception occured, cause: ", ex);
      MessageUtils.addErrorMessage("error.dataSource");
    }
    return "opportunityDetail";
View Full Code Here

TOP

Related Classes of de.xanders.data.customer.vo.OpportunityVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.