Package com.jada.admin.tax

Examples of com.jada.admin.tax.TaxListingActionForm


    public ActionForward start(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
        TaxListingActionForm form = (TaxListingActionForm) actionForm;
        form.setTaxes(null);
      if (form.getSrPublished() == null) {
        form.setSrPublished("*");
      }
        ActionForward actionForward = actionMapping.findForward("success");
        return actionForward;
    }
View Full Code Here


                              HttpServletRequest request,
                              HttpServletResponse response)
        throws Throwable {

      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxListingActionForm form = (TaxListingActionForm) actionForm;
        AdminBean adminBean = getAdminBean(request);
        Site site = adminBean.getSite();
        initSiteProfiles(form, site);
       
        if (form.getSrTaxCode() == null) {
          return start(actionMapping, actionForm, request, response);
        }

        Query query = null;
        String sql = "select  tax " +
               "from    Tax tax " +
               "where   siteId = :siteId ";
        if (form.getSrTaxCode().length() > 0) {
          sql += "and tax.taxLanguage.taxCode like :taxCode ";
        }
        if (!form.getSrPublished().equals("*")) {
          sql += "and published = :published ";
        }
        sql += "order by taxId";
        query = em.createQuery(sql);
        query.setParameter("siteId", site.getSiteId());
        if (form.getSrTaxCode().length() > 0) {
          query.setParameter("taxCode", "%" + form.getSrTaxCode() + "%");
        }
        if (!form.getSrPublished().equals("*")) {
          query.setParameter("published", form.getSrPublished());
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<TaxDisplayForm> vector = new Vector<TaxDisplayForm>();
        while (iterator.hasNext()) {
          Tax tax = (Tax) iterator.next();
          TaxLanguage taxLanguage = null;
          for (TaxLanguage language : tax.getTaxLanguages()) {
            if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
              taxLanguage = language;
            }
          }
        TaxDisplayForm taxDisplay = new TaxDisplayForm();
        taxDisplay.setTaxId(Format.getLong(tax.getTaxId()));
        taxDisplay.setTaxCode(taxLanguage.getTaxCode());
        taxDisplay.setTaxName(taxLanguage.getTaxName());
        taxDisplay.setTaxRate(Format.getFloatObj4(tax.getTaxRate()));
        taxDisplay.setPublished(String.valueOf(tax.getPublished()));
        vector.add(taxDisplay);
        }
        form.setTaxes(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
        return actionForward;
    }
View Full Code Here

    public ActionForward back(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
        TaxListingActionForm form = (TaxListingActionForm) actionForm;
        if (form.getTaxes() != null) {
          return list(actionMapping, actionForm, request, response);
        }
        else {
          return start(actionMapping, actionForm, request, response);
        }
View Full Code Here

            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
     
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxListingActionForm form = (TaxListingActionForm) actionForm;
        String taxIds[] = form.getTaxIds();
       
        if (taxIds != null) {
          for (int i = 0; i < taxIds.length; i++) {
              Tax tax = new Tax();
              tax = TaxDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(taxIds[i]));
View Full Code Here

TOP

Related Classes of com.jada.admin.tax.TaxListingActionForm

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.