예제 #1
0
  public ArrayList<PricingGroupBean> getAllPricingGroups() {

    ArrayList<PricingGroupBean> arrPricingGroupBean = new ArrayList<PricingGroupBean>();

    String sQuery = "select * from GTPRICEGROUP GPG";

    ArrayList<Object> aParams = new ArrayList<Object>();

    ArrayList<HashMap<String, String>> arrResult =
        DBDAO.getDBData(
            ADMIN_DB, sQuery, aParams, false, "PricingGroupData.java", "getPricingGroups()");

    if (arrResult != null && !arrResult.isEmpty()) {
      for (HashMap<String, String> hmResult : arrResult) {
        PricingGroupBean pricingGroupBean = new PricingGroupBean(hmResult);

        arrPricingGroupBean.add(pricingGroupBean);
      }
    }
    return arrPricingGroupBean;
  }
예제 #2
0
  public PricingGroupBean getPricingGroup(String sPricingGroupId) {

    PricingGroupBean pricingGroupBean = new PricingGroupBean();
    if (sPricingGroupId != null && !"".equalsIgnoreCase(sPricingGroupId)) {
      String sQuery = "select * " + " from GTPRICEGROUP GPG WHERE PRICEGROUPID = ?";

      ArrayList<Object> aParams = new ArrayList<Object>();
      aParams.add(sPricingGroupId);

      ArrayList<HashMap<String, String>> arrResult =
          DBDAO.getDBData(
              ADMIN_DB, sQuery, aParams, false, "PricingGroupData.java", "getPricingGroups()");

      if (arrResult != null && !arrResult.isEmpty()) {
        for (HashMap<String, String> hmResult : arrResult) {

          pricingGroupBean = new PricingGroupBean(hmResult);
          break;
        }
      }
    }
    return pricingGroupBean;
  }