Package com.centraview.contact.individual

Examples of com.centraview.contact.individual.IndividualLocalHome


        }catch(Exception e){
          logger.error("[getEntityVOWithBasicReferences] Exception thrown.", e);
        } //end of catch block (Exception)
      } // end if (envo.getCreatedBy() != 0)

      IndividualLocalHome ih = (IndividualLocalHome)ic.lookup("local/Individual");

      try {
        IndividualLocal il = ih.findByPrimaryContact(cntId, this.dataSource);
        IndividualVO iv = il.getIndividualVOBasic();
        this.envo.setIndividualVO(iv);
      }catch(FinderException e){
        IndividualVO iv = new IndividualVO();
        iv.setEntityID(this.envo.getContactID());
        this.envo.setIndividualVO(iv);
      }

      if (this.envo.getAccManager() != 0) {
        try {
          IndividualLocal ilAccMang = ih.findByPrimaryKey(new IndividualPK(envo.getAccManager(), this.dataSource));
          IndividualVO indAccMang =   ilAccMang.getIndividualVOBasic();
          this.envo.setAcctMgrName(indAccMang.getFirstName()+" "+indAccMang.getLastName());
        }catch(Exception e){
          logger.error("[getEntityVOWithBasicReferences] Exception thrown.", e);
          this.envo.setAcctMgrName("");
View Full Code Here


        remote.addMOC((MethodOfContactVO)(mocIter.next()), newEntityID, contactType, individualID, false);
      }

      IndividualVO individualVO = entityVO.getIndividualVO();
      if (individualVO != null && individualVO.getContactID() <= 0) {
        IndividualLocalHome ih = (IndividualLocalHome)ic.lookup("local/Individual");
        individualVO.setEntityID(newEntityID);
        ih.create(individualVO, individualID, dataSource);
      }
      // Save CustomFields from the Form (which is only the 3 on the form)
      CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal custRemote = custHome.create();
      custRemote.setDataSource(dataSource);
View Full Code Here

        IndividualVO newInd = this.envo.getIndividualVO();
     
        if (newInd != null) {
          if (newInd.getContactID() == 0) {
            // if the ID is zero there wasn't a primary contact for this entity, so create one.
            IndividualLocalHome ih = (IndividualLocalHome)ic.lookup("local/Individual");
            newInd.setEntityID(entId);
            ih.create(newInd, modBy, this.dataSource);
          } else {
            // otherwise the changePrimaryContact method does a bunch of stuff.
            this.changePrimaryContact();
          }
        }
View Full Code Here

      dl.setSqlQueryToNull();

      Iterator iter = resultVector.iterator();

      IndividualLocalHome homeIndividual = (IndividualLocalHome)ic.lookup("local/Individual");

      while (iter.hasNext())
      {
        HashMap customField = (HashMap) iter.next();
        IndividualLocal il = homeIndividual.findByPrimaryKey( new IndividualPK(Integer.parseInt(customField.get("id").toString()),this.dataSource));
        il.remove();
      }

      //Delete Custom Field
      dl.setSql("contact.deletecustomfieldscalar");
View Full Code Here

    {
      InitialContext ic = CVUtility.getInitialContext();
      IndividualVO newIndividualVO = this.envo.getIndividualVO();
      IndividualVO oldIndividualVO = this.oldEntityVO.getIndividualVO();

      IndividualLocalHome ih = (IndividualLocalHome)ic.lookup("local/Individual");

      if (newIndividualVO.getContactID() != oldIndividualVO.getContactID())
      {
        // the primary contact was changed. so ...
        try
        {
          // set the old guy to not be the primary contact
          IndividualLocal oldIndividualEntityBean = ih.findByPrimaryKey(new IndividualPK(oldIndividualVO.getContactID(), this.dataSource));
          oldIndividualVO.setIsPrimaryContact("NO");
          oldIndividualEntityBean.setIndividualVO(oldIndividualVO);
        } catch (FinderException fe) {
          logger.info("[changePrimaryContact] old primary contact: "+oldIndividualVO.getContactID()+", not found.");
        }
        // set the the new one to be the primary contact
        IndividualLocal newIndividualEntityBean = ih.findByPrimaryKey(new IndividualPK(newIndividualVO.getContactID(), this.dataSource));
        newIndividualVO.setIsPrimaryContact("YES");
        newIndividualEntityBean.setIndividualVO(newIndividualVO);
      } else {
        // The selected primary contact is the same as the previous primary contact, just
        // need to set it as primary.
        IndividualLocal individualEntityBean = ih.findByPrimaryKey(new IndividualPK(newIndividualVO.getContactID(), this.dataSource));
        newIndividualVO.setIsPrimaryContact("YES");
        individualEntityBean.setIndividualVO(newIndividualVO);
      }
    } catch(Exception e) {
      logger.error("[changePrimaryContact] Exception thrown.", e);
View Full Code Here

TOP

Related Classes of com.centraview.contact.individual.IndividualLocalHome

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.