Examples of ItemLocalHome


Examples of com.centraview.account.item.ItemLocalHome

  public void deleteItem(int individualID, int itemId) throws ItemException, NamingException,
      CreateException
  {
    InitialContext ic = CVUtility.getInitialContext();
    ItemLocalHome home = (ItemLocalHome) ic.lookup("local/Item");
    ItemLocal invoice = home.create();
    invoice.setDataSource(this.dataSource);
    invoice.deleteItem(individualID, itemId);
  }
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

        ItemElement ie = (ItemElement)itemLines.get(itr.next());
        int id = ((Integer)((IntMember)ie.get("ItemId")).getMemberValue()).intValue();
        try
        {
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,id);
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;

          if (invoiceVO.getShipToId()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);

            AddressVO addVO = contactHelperLocal.getAddress(invoiceVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);

        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

        ItemElement ie = (ItemElement)itemLines.get(itr.next());
        int id = ((Integer)((IntMember)ie.get("ItemId")).getMemberValue()).intValue();
        try
        {
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,id);
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;

          if (orderVO.getShipToAddIdValue()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(orderVO.getShipToAddIdValue());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);
          System.out.println("[Exception][AccountHelperEJB.calculateOrderItems] Exception Thrown: "+e);
        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

        ItemElement ie = (ItemElement)itemLines.get(itr.next());
        int id = ((Integer)((IntMember)ie.get("ItemId")).getMemberValue()).intValue();
        try
        {
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,id);
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (purchaseOrderVO.getShipToId()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(purchaseOrderVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);
          System.out.println("[Exception][AccountHelperEJB.calculatePurchaseOrderItems] Exception Thrown: "+e);
        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);


          //Get the Required Fields from the Item VO
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

        {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId,intToken);

          //Get the Required Fields from the Item VO
          String name = item.getItemName();
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

         {
           String syncDatePrKeyField[] = {""};
           Timestamp lastSyncDate = (Timestamp)params.get("lastSyncDate");
           String operation = (String)params.get("Operation");
           InitialContext ic = CVUtility.getInitialContext();
           ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
           ItemLocal itemL = home.create();

           Collection col = getList((String)params.get("itemname"),lastSyncDate,operation,syncDatePrKeyField);
           Object ids[] = col.toArray();
           HashMap hm = new HashMap();
           int size = ids.length;
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

         int newId = 0;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
           ItemLocal itemL = home.create();

           int size = IVOs.size();

            for ( int i=0;i<size;i++) {
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

       {
         ItemVO ivo = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
           ItemLocal itemL = home.create();

           int size = IVOs.size();

           for ( int i=0;i<size;i++)
           {
View Full Code Here

Examples of com.centraview.account.item.ItemLocalHome

        // ItemElement ie = (ItemElement)itr.next();
        ItemElement ie = (ItemElement) itemLines.get(itr.next());
        int id = ((Integer) ((IntMember) ie.get("ItemId")).getMemberValue()).intValue();
        try {
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome) ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);

          ItemVO item = itemLocal.getItem(userId, id);

          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          int shipToId = 0;

          if (proposalVO.getShippingaddressid() != null) {
            shipToId = Integer.parseInt(proposalVO.getShippingaddressid());
          }

          if (shipToId != 0) {
            AccountHelperHome hm = (AccountHelperHome) ic.lookup("local/AccountHelper");
            AccountHelper accHelper = hm.create();
            accHelper.setDataSource(this.dataSource);

            ContactHelperLocalHome home1 = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);

            if (taxJurisdictionId != 0) {
              taxRate = accHelper.getTax(taxClassId, taxJurisdictionId);
            } // end if (taxJurisdictionId != 0)
          } // end if (shipToId != 0)

          ((FloatMember) ie.get("UnitTaxrate")).setMemberValue(taxRate);

        } // end try block
        catch (Exception e) {
          ((FloatMember) ie.get("UnitTaxrate")).setMemberValue(0.0f);
        } // end of catch block (Exception)
      } // end of while loop (itr.hasNext())
    } // end of if statement (counter != 0)

    if (newItemID != null && !newItemID.equals("")) {
      st = new StringTokenizer(newItemID, ",");

      while (st.hasMoreTokens()) {
        try {
          float taxRate = 0.0f;
          token = st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();

          float promotionPrice = 0.0f;

          CVDal dl = new CVDal(this.dataSource);
          dl.setSqlQueryToNull();
          dl.setSql("promotion.getpromotionitem");
          dl.setInt(1, intToken);
          Collection col = dl.executeQuery();

          if (col != null && col.size() != 0) {
            Iterator it = col.iterator();
            HashMap hm = (HashMap) it.next();
            if (hm != null) {
              promotionPrice = ((Number) hm.get("Price")).floatValue();
              // FIXME promotions broken here!
              Date promotionStartdate = ((Date) hm.get("Startdate"));
              Date promotionEnddate = ((Date) hm.get("Enddate"));
            }
          }

          dl.clearParameters();
          dl.destroy();

          ItemLocalHome home = (ItemLocalHome) ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId, intToken);

          // Get the Required Fields from the Item VO
          String name = item.getItemName();
View Full Code Here

Examples of xpetstore.domain.catalog.interfaces.ItemLocalHome

     */
    public Collection getCartItems(  )
    {
        try
        {
            ItemLocalHome ihome = ItemUtil.getLocalHome(  );
            ArrayList     items = new ArrayList(  );
            Iterator      it = _details.keySet(  ).iterator(  );
            while ( it.hasNext(  ) )
            {
                String  key = ( String ) it.next(  );
                Integer value = ( Integer ) _details.get( key );
                try
                {
                    ItemLocal    ilocal = ihome.findByPrimaryKey( key );
                    ItemValue    item = ilocal.getItemValue(  );
                    ProductValue prod = ilocal.getProduct(  ).getProductValue(  );

                    CartItem     ci = new CartItem( item.getItemId(  ), prod.getProductId(  ), prod.getName(  ), item.getDescription(  ), value.intValue(  ), item.getListPrice(  ) );

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.