Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomerClass


    customer.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    if (!Format.isNullOrEmpty(form.getCustPassword())) {
      customer.setCustPassword(AESEncoder.getInstance().encode(form.getCustPassword()));
    }
    if (!Format.isNullOrEmpty(form.getCustClassId())) {
      CustomerClass customerClass = (CustomerClass) em.find(CustomerClass.class, Format.getLong(form.getCustClassId()));
      if (customerClass != null) {
        customer.setCustomerClass(customerClass);
      }
    }
    else {
View Full Code Here


      form.setCustCreditCardExpiryMonth(customerCreditCard.getCustCreditCardExpiryMonth());
      form.setCustCreditCardExpiryYear(customerCreditCard.getCustCreditCardExpiryYear());
      form.setCustCreditCardVerNum(customerCreditCard.getCustCreditCardVerNum());
    }
   
    CustomerClass customerClass = customer.getCustomerClass();
    form.setCustClassId("");
    if (customerClass != null) {
      form.setCustClassId(customerClass.getCustClassId().toString());
    }
  }
View Full Code Here

    query = em.createQuery(sql);
    query.setParameter("siteId", siteId);
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> custClassList = new Vector<LabelValueBean>();
    while (iterator.hasNext()) {
      CustomerClass customerClass = (CustomerClass) iterator.next();
      LabelValueBean bean = new LabelValueBean(customerClass.getCustClassName(), customerClass.getCustClassId().toString());;
      custClassList.add(bean);
    }
    LabelValueBean custClasses[] = new LabelValueBean[custClassList.size()];
    custClassList.copyInto(custClasses);
    form.setCustClasses(custClasses);
View Full Code Here

        CustomerClassMaintActionForm form = (CustomerClassMaintActionForm) actionForm;
        if (form == null) {
            form = new CustomerClassMaintActionForm();
        }
    String custClassId = request.getParameter("custClassId");
        CustomerClass customerClass = new CustomerClass();
        customerClass = CustomerClassDAO.load(site.getSiteId(), Format.getLong(custClassId));
        form.setMode("U");
        copyProperties(form, customerClass);
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

   
      Site site = getAdminBean(request).getSite();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    CustomerClassMaintActionForm form = (CustomerClassMaintActionForm) actionForm;
    try {
      CustomerClass customerClass = CustomerClassDAO.load(site.getSiteId(), Format.getLong(form.getCustClassId()));
      em.remove(customerClass);
      em.getTransaction().commit();
    }
    catch (Exception e) {
      if (Utility.isConstraintViolation(e)) {
View Full Code Here

      insertMode = true;
    }

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    CustomerClass customerClass = new CustomerClass();
    if (!insertMode) {
      customerClass = CustomerClassDAO.load(site.getSiteId(), Format.getLong(form.getCustClassId()));
    }

    ActionMessages errors = validate(form);
    if (errors.size() != 0) {
      saveMessages(request, errors);
      return mapping.findForward("error");
    }

    if (insertMode) {
      customerClass.setRecCreateBy(adminBean.getUser().getUserId());
      customerClass.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customerClass.setSystemRecord(Constants.VALUE_NO);
    }
    customerClass.setSite(site);
    customerClass.setCustClassName(form.getCustClassName());
    customerClass.setRecUpdateBy(adminBean.getUser().getUserId());
    customerClass.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    if (insertMode) {
      em.persist(customerClass);
    }
    else {
      // em.update(customerClass);
    }
        form.setMode("U");
        form.setCustClassId(customerClass.getCustClassId().toString());
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    return mapping.findForward("success");
  }
View Full Code Here

          query.setParameter("custClassName", "%" + form.getSrCustClassName() + "%");
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<CustomerClassDisplayForm> vector = new Vector<CustomerClassDisplayForm>();
        while (iterator.hasNext()) {
          CustomerClass customerClass = (CustomerClass) iterator.next();
        CustomerClassDisplayForm customerClassDisplay = new CustomerClassDisplayForm();
        customerClassDisplay.setCustClassId(Format.getLong(customerClass.getCustClassId()));
        customerClassDisplay.setCustClassName(customerClass.getCustClassName());
        customerClassDisplay.setSystemRecord(String.valueOf(customerClass.getSystemRecord()));
        vector.add(customerClassDisplay);
        }
        form.setCustClasses(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

        String custClassIds[] = form.getCustClassIds();
       
        try {
          if (custClassIds != null) {
            for (int i = 0; i < custClassIds.length; i++) {
                CustomerClass customerClass = new CustomerClass();
                customerClass = CustomerClassDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(custClassIds[i]));
                if (customerClass.getSystemRecord() == Constants.VALUE_YES) {
                  continue;
                }
                em.remove(customerClass);
            }
            em.getTransaction().commit();
View Full Code Here

   
    static public boolean isApplicable(ItemTierPrice itemTierPrice, Customer customer) {
      if (!isPublished(itemTierPrice)) {
        return false;
      }
      CustomerClass customerClass = itemTierPrice.getCustomerClass();
      if (customerClass == null) {
        return true;
      }
      if (customer == null) {
        return false;
View Full Code Here

    sql = "from     CustomerClass customerClass " +
            "where    customerClass.site.siteId = :siteId " +
            "and      customerClass.systemRecord = 'Y'";
    query = em.createQuery(sql);
    query.setParameter("siteId", siteId);
    CustomerClass customerClass = (CustomerClass) query.getSingleResult();
       
        Customer customer = new Customer();
        customer.setSite(site);
    if (singleCheckout == Constants.VALUE_YES) {
      SiteDomain siteDomain = (SiteDomain) em.find(SiteDomain.class, defaultSiteDomainId);
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.CustomerClass

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.