Package com.centraview.account.item

Examples of com.centraview.account.item.ItemList


      } // end of if(typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      else if (typeOfOperation != null &&typeOfOperation.equals("ADDITEM"))
      {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = ((PurchaseOrderForm)form).getItemLines();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)st.nextToken();
            int intToken = Integer.parseInt(token);
            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext())
            {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();

              if ( listItemid.intValue() == intToken )
              {
View Full Code Here


      else if (request.getParameter(MarketingConstantKeys.TYPEOFOPERATION) != null)
        if (request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).equals("ADDITEM"))
        {
          String newItemID = request.getParameter("theitemid");

          ItemList IL = null;

          ListGenerator lg = ListGenerator.getListGenerator(dataSource); //get the List Generator object for Listing
          IL = (ItemList)lg.getItemList(individualId, 1, 10, "", "ItemID"); //called when the request for the list is for first time

          StringTokenizer st;
          String token, nextItr;
          Iterator itr = IL.keySet().iterator();

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

            if (itemLines == null)
              itemLines = new ItemLines();
            int counter = itemLines.size();
            while (st.hasMoreTokens())
            {
              token = (String)st.nextToken();
              int intToken = Integer.parseInt(token);

              while (itr.hasNext())
              {
                nextItr = (String)itr.next();
                ListElement ile = (ListElement)IL.get(nextItr);
                IntMember smid = (IntMember)ile.get("ItemID");
                Integer listItemid = (Integer)smid.getMemberValue();

                if (listItemid.intValue() == intToken)
                {
View Full Code Here

      //----------  ADD item
      else if (typeOfOperation != null &&  typeOfOperation.equals("ADDITEM") )
      {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = ((PurchaseOrderForm)form).getItemLines();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)st.nextToken();
            int intToken = Integer.parseInt(token);

            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext())
            {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();

              if ( listItemid.intValue() == intToken )
              {
View Full Code Here

        }// end of if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals(AccountConstantKeys.REMOVEITEM))
        /*   ADD item */
        else if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals(AccountConstantKeys.ADDITEM)) {

          String newItemID = request.getParameter("theitemid");
          ItemList IL = null ;
          ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
          IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

          StringTokenizer st;
          String token, nextItr;
          if (newItemID != null)
          {
            st = new StringTokenizer(newItemID, ",");
            itemLines = ((InvoiceForm)form).getItemLines();

            if(itemLines == null)
              itemLines = new ItemLines();
            int counter = itemLines.size();
            while (st.hasMoreTokens())
            {
              token   = (String)st.nextToken();
              int intToken = Integer.parseInt(token);

              Iterator itr = IL.keySet().iterator();
              while (itr.hasNext())
              {
                nextItr = (String)itr.next();
                ListElement ile = (ListElement)IL.get(nextItr);
                IntMember smid = (IntMember)ile.get("ItemID");
                Integer listItemid = (Integer)smid.getMemberValue();

                if ( listItemid.intValue() == intToken )
                {
View Full Code Here

       
        itemLines.calculate();
        proposalListForm.setItemLines(itemLines);
      }else if ((typeOfOperation != null) && typeOfOperation.equals("ADDITEM")){
        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);
        IL = (ItemList)lg.getItemList(individualID, 1, 10, "", "ItemID");

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null) {
          st = new StringTokenizer(newItemID, ",");
          itemLines = proposalListForm.getItemLines();
         
          if (itemLines == null) {
            itemLines = new ItemLines();
          }
         
          int counter = itemLines.size();
         
          while (st.hasMoreTokens()) {
            token = (String)st.nextToken();
            int intToken = Integer.parseInt(token);
           
            Iterator itr = IL.keySet().iterator();
           
            while (itr.hasNext()) {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();
             
              if (listItemid.intValue() == intToken) {
                StringMember smName = (StringMember)ile.get("Name"); // name = description
View Full Code Here

   * @return
   */
  public ItemList getItemList(int individualID, DisplayList DLparam)
  {

    ItemList returnDL = null;
    ItemList paramDL = (ItemList)DLparam;
    int listSize = paramDL.getTotalNoOfRecords();
    int startAT = paramDL.getStartAT();
    int EndAt = paramDL.getEndAT();

    String powerString = paramDL.getPowerString();
    String searchString = paramDL.getSearchString();
    String sortColumn = paramDL.getSortMember();

    HashMap hm = new HashMap();
    hm.put("startATparam", new Integer(startAT));
    hm.put("EndAtparam", new Integer(EndAt));
    hm.put("searchString", searchString);
    hm.put("sortmem", DLparam.getSortMember());
    hm.put("sortType", new Character(DLparam.getSortType()));

    try {
      AccountListHome aa = (AccountListHome)CVUtility.getHomeObject(
          "com.centraview.account.accountlist.AccountListHome", "AccountList");
      AccountList remote = (AccountList)aa.create();
      remote.setDataSource(this.dataSource);
      returnDL = remote.getItemList(individualID, hm);
    } catch (Exception e) {
      System.out.println("[Exception] ListGenerator.getItemList: " + e.toString());
      // e.printStackTrace();
    }

    returnDL.setListType("Item");
    returnDL.setListID(paramDL.getListID());
    returnDL.setStartAT(paramDL.getStartAT());
    returnDL.setEndAT(paramDL.getEndAT());
    returnDL.setSortType(paramDL.getSortType());
    returnDL.setSearchString(searchString);
    returnDL.setPowerString(powerString);

    if (searchString != null && searchString.startsWith("SIMPLE :"))
      returnDL.search();
View Full Code Here

      } // end of else if statement
      // (viewOperation.equalsIgnoreCase(ProposalConstantKeys.REMOVEITEM))
      else if (viewOperation.equalsIgnoreCase(ProposalConstantKeys.ADDITEM)) {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);
        IL = lg.getItemList(individualID, 1, 10, "", "ItemID");
        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null) {
          st = new StringTokenizer(newItemID, ",");
          itemLines = proposallistform.getItemLines();

          if (itemLines == null)
            itemLines = new ItemLines();
          counter = itemLines.size();
          while (st.hasMoreTokens()) {
            token = st.nextToken();
            int intToken = Integer.parseInt(token);

            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext()) {
              nextItr = (String) itr.next();
              ListElement ile = (ListElement) IL.get(nextItr);
              IntMember smid = (IntMember) ile.get("ItemID");
              Integer listItemid = (Integer) smid.getMemberValue();

              if (listItemid.intValue() == intToken) {
View Full Code Here

    int intEndParam = intEnd.intValue();

    int beginIndex = 0;
    Float f = new Float(5);

    ItemList list = new ItemList();
    list.setSortMember(strSortMem);

    CVDal cvdl = new CVDal(dataSource);

    Collection colList;
    String sortType= "";
    if (charSort == 'D')
    {
          sortType = "DESC";
    }
    String appendSearchCondition ="";
    if ((strSearch != null) && strSearch.startsWith("ADVANCE:"))
    {
      int searchIndex = (strSearch.toUpperCase()).indexOf("WHERE");
      appendSearchCondition = " and "+strSearch.substring((searchIndex+5),strSearch.length());
    }

  String itemQuery = " select item.itemid,item.sku,item.title as Name ,itemtype.title as type ,item.listprice as Price ,count(inventory.qty) as OnHand ,taxclass.taxclassid as taxclassid ,taxclass.title as taxclass,item.cost ,"+
             " ven.entityid as vendorid,ven.name as vendor,man.entityid as manid, man.name as manufacturer  from  item left outer join itemtype on item.type = itemtype.itemtypeid "+
             " left outer join inventory on item.itemid = inventory.item left outer join taxclass on item.taxclass = taxclass.taxclassid "+
             " left outer join entity man on item.manufacturerid = man.entityid   left outer join entity ven on item.vendorid = ven.entityid "+
             " where item.deletestatus != 'Deleted' "+appendSearchCondition+" Group by item.itemid,item.sku,item.title,itemtype.title,item.listprice, taxclass.title,item.cost order by '"+ strSortMem +"' "+sortType;
  cvdl.setSqlQuery(itemQuery);
    colList = cvdl.executeQuery();
    cvdl.clearParameters();
    cvdl.destroy();

    if (colList != null)
    {
      Iterator it = colList.iterator();

      int i = 0;

      while (it.hasNext())
      {
        i++;

        HashMap hm = (HashMap) it.next();
        int id = ((Long) hm.get("itemid")).intValue();

        try
        {
          IntMember intListID =
            new IntMember("ItemID", id, 10, "", 'T', false, 10);

          StringMember strSku = null;

          if ((hm.get("sku") != null))
          {
            strSku =
              new StringMember("SKU", (String) hm.get("sku"), 10, "", 'T', true);
          }
          else
          {
            strSku = new StringMember("SKU", null, 10, "", 'T', true);
          }

          StringMember strName =
            new StringMember("Name", (String) hm.get("Name"), 10, "", 'T', false);

          //          StringMember strCatagory = new StringMember("Category", (String)hm.get("categoryname"), 10, "", 'T', false);new Float(((Double) hm.get( "cost" )).floatValue())
          StringMember strType =
            new StringMember("Type", (String) hm.get("type"), 10, "", 'T', false);

          FloatMember price = null;

          if (hm.get("Price") != null)
          {
            price =
              new FloatMember("Price",
                new Float(Float.parseFloat((hm.get("Price")).toString())), 10,
                "", 'T', false, 10);
          }
          else
          {
            price =
              new FloatMember("Price", new Float(0), 10, "", 'T', false, 10);
          }

          DoubleMember intQty = null;

          if (hm.get("OnHand") != null)
          {
            intQty =
              new DoubleMember("OnHand",
                new Double(Double.parseDouble((hm.get("OnHand")).toString())),
                10, "", 'T', false, 10);
          }
          else
          {
            intQty =
              new DoubleMember("OnHand", new Double(0), 10, "", 'T', false, 10);
          }

          StringMember strtaxClass =
            new StringMember("TaxClass", (String) hm.get("taxclass"), 10, "",
              'T', false);


          int taxClassId = ((Number) hm.get("taxclassid")).intValue();

          IntMember intTaxClassID = new IntMember("TaxClassID", taxClassId, 10, "", 'T', false, 10);

          FloatMember cost =
            new FloatMember("Cost",
              new Float(Float.parseFloat((hm.get("cost")).toString())), 10, "",
              'T', false, 10);

          //Added by Shilpa for getting Manufacture and Vendor for item
          int manid = 0;
          int venid = 0;

          if (hm.get("manid") != null)
          {
            manid = ((Long) hm.get("manid")).intValue();
          }

          IntMember manufacturerID =
            new IntMember("ManufacturerID", manid, 10, "", 'T', false, 10);

          if (hm.get("vendorid") != null)
          {
            venid = ((Long) hm.get("vendorid")).intValue();
          }

          IntMember vendorID =
            new IntMember("VendorID", venid, 10, "", 'T', false, 10);

          StringMember strVendor = null;
          StringMember strManufacturer = null;

          if (hm.get("vendor") != null)
          {
            strVendor =
              new StringMember("Vendor", (String) hm.get("vendor"), 10, "",
                'T', false);
          }

          if (hm.get("manufacturer") != null)
          {
            strManufacturer =
              new StringMember("Manufacturer", (String) hm.get("manufacturer"),
                10, "", 'T', false);
          }

          //Added by shilpa ends here
          ItemListElement listElement = new ItemListElement(id);

          listElement.put("ItemID", intListID);
          listElement.put("SKU", strSku);
          listElement.put("Name", strName);

          //          listElement .put("Category", strCatagory);
          listElement.put("Type", strType);
          listElement.put("Price", price);
          listElement.put("OnHand", intQty);
          listElement.put("TaxClass", strtaxClass);
          listElement.put("TaxClassID", intTaxClassID);

          listElement.put("Cost", cost);

          //Added By Shilpa
          listElement.put("VendorID", vendorID);
          listElement.put("Vendor", strVendor);
          listElement.put("Manufacturer", strManufacturer);
          listElement.put("ManufacturerID", manufacturerID);

          //Added By Shilpa ends here
          StringBuffer stringbuffer = new StringBuffer("00000000000");
          stringbuffer.setLength(11);

          String s3 = (new Integer(i)).toString();
          stringbuffer.replace(stringbuffer.length() - s3.length(),
            stringbuffer.length(), s3);

          String s4 = stringbuffer.toString();

          list.put(s4, listElement);
        }
        catch (Exception e)
        {
          System.out.println(" Exception in AccountListEJB.getItemList  " + e);

          //e.printStackTrace();
        }
      }
    }

    list.setTotalNoOfRecords(list.size());
    list.setListType("Item");
    list.setBeginIndex(beginIndex);
    list.setEndIndex(list.size());

    return list;
  }
View Full Code Here

TOP

Related Classes of com.centraview.account.item.ItemList

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.