Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShippingType


        saveCurrency(item, form, adminBean);
      }     
    }
   
    if (!Format.isNullOrEmpty(form.getShippingTypeId())) {
      ShippingType shippingType = (ShippingType) em.find(ShippingType.class, Format.getLong(form.getShippingTypeId()));
      if (shippingType != null) {
        item.setShippingType(shippingType);
      }
    }
    else {
View Full Code Here


    Query query = em.createQuery("from ShippingType shippingType where siteId = :siteId order by shippingTypeName");
    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> shippingTypeList = new Vector<LabelValueBean>();
    while (iterator.hasNext()) {
      ShippingType shippingType = (ShippingType) iterator.next();
      LabelValueBean bean = new LabelValueBean(shippingType.getShippingTypeName(), shippingType.getShippingTypeId().toString());
      shippingTypeList.add(bean);
    }
    LabelValueBean shippingTypes[] = new LabelValueBean[shippingTypeList.size()];
    shippingTypeList.copyInto(shippingTypes);
    form.setShippingTypes(shippingTypes);
View Full Code Here

      form.setCustomAttribGroupName(item.getCustomAttributeGroup().getCustomAttribGroupName());
    }
    form.setRemoveImages(null);
    form.setRemoveMenus(null);
    form.setMenuWindowMode("");
    ShippingType shippingType = item.getShippingType();
    if (shippingType != null) {
      form.setShippingTypeId(shippingType.getShippingTypeId().toString());
    }
    ProductClass productClass = item.getProductClass();
    if (productClass != null) {
      form.setProductClassId(productClass.getProductClassId().toString());
    }
View Full Code Here

    Query query = em.createQuery(sql);
    query.setParameter("siteId", siteId);
    Iterator<?> iterator = query.getResultList().iterator();
    Vector<ShippingType> stVector = new Vector<ShippingType>();
    while (iterator.hasNext()) {
      ShippingType shippingType = (ShippingType) iterator.next();
      stVector.add(shippingType);
    }
    ShippingType shippingTypes[] = new ShippingType[stVector.size()];
    stVector.toArray(shippingTypes);
   
    Vector<JSONEscapeObject> jsonShippingRegions = new Vector<JSONEscapeObject>();
    sql = "from ShippingRegion shippingRegion where shippingRegion.site.siteId = :siteId and shippingRegionName = :shippingRegionName order by shippingRegionName";
    query = em.createQuery(sql);
View Full Code Here

        Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
        Query query = em.createQuery("from ShippingType where siteId = :siteId order by shippingTypeName");
        query.setParameter("siteId", form.getSiteId());
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          ShippingType shippingType = (ShippingType) iterator.next();
          LabelValueBean bean = new LabelValueBean();
          bean.setLabel(shippingType.getShippingTypeName());
          bean.setValue(shippingType.getShippingTypeId().toString());
          vector.add(bean);
        }
        LabelValueBean shippingTypes[] = new LabelValueBean[vector.size()];
        vector.copyInto(shippingTypes);
        form.setShippingTypes(shippingTypes);
View Full Code Here

        ShippingTypeMaintActionForm form = (ShippingTypeMaintActionForm) actionForm;
        if (form == null) {
            form = new ShippingTypeMaintActionForm();
        }
    String shippingTypeId = request.getParameter("shippingTypeId");
        ShippingType shippingType = new ShippingType();
        shippingType = ShippingTypeDAO.load(site.getSiteId(), Format.getLong(shippingTypeId));
        form.setMode("U");
        copyProperties(form, shippingType);
        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();
    ShippingTypeMaintActionForm form = (ShippingTypeMaintActionForm) actionForm;
    try {
      ShippingType shippingType = ShippingTypeDAO.load(site.getSiteId(), Format.getLong(form.getShippingTypeId()));
      Iterator<?> iterator = shippingType.getShippingMethodRegionTypes().iterator();
      while (iterator.hasNext()) {
        ShippingMethodRegionType shippingMethodRegionType = (ShippingMethodRegionType) iterator.next();
        em.remove(shippingMethodRegionType.getShippingRate());
        em.remove(shippingMethodRegionType);
      }
View Full Code Here

      insertMode = true;
    }

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    ShippingType shippingType = new ShippingType();
    if (!insertMode) {
      shippingType = ShippingTypeDAO.load(site.getSiteId(), Format.getLong(form.getShippingTypeId()));
    }

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

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

    em.persist(item);
   
    CategorySearchUtil.itemPriceSearchUpdate(item, site, adminBean);
    CategorySearchUtil.itemDescSearchUpdate(item, site, adminBean);
   
    ShippingType shippingType = null;
    if (shippingTypeId != null) {
      shippingType = ShippingTypeDAO.load(siteId, shippingTypeId);
    }
    else {
      shippingType = ShippingTypeDAO.loadByName(siteId, shippingTypeName);
View Full Code Here

    sql = "from ShippingType where siteId = :siteId";
    query = em.createQuery(sql);
    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
        ShippingType shippingType = (ShippingType) iterator.next();
        em.remove(shippingType);
    }
 
        sql = "from State where stateId in (select stateId from State state where state.country.site.siteId = :siteId)";
        query = em.createQuery(sql);
View Full Code Here

TOP

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

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.