Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.User


            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      CreditMaintActionForm form = (CreditMaintActionForm) actionForm;
    MessageResources resources = this.getResources(request);
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
     
      CreditHeader creditHeader = (CreditHeader) em.find(CreditHeader.class, Format.getLong(form.getCreditHeaderId()));
      CreditEngine creditEngine = new CreditEngine(creditHeader, user);
View Full Code Here


            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      CreditMaintActionForm form = (CreditMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
    OrderHeader orderHeader = invoiceHeader.getOrderHeader();
    getMissingFormInformation(form, adminBean.getSiteId());
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      CreditMaintActionForm form = (CreditMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    CreditHeader creditHeader = (CreditHeader) em.find(CreditHeader.class, Format.getLong(form.getCreditHeaderId()));
    getMissingFormInformation(form, adminBean.getSiteId());
View Full Code Here

    CreditHeader creditHeader = (CreditHeader) em.find(CreditHeader.class, Format.getLong(form.getCreditHeaderId()));
    getMissingFormInformation(form, getAdminBean(request).getSiteId());
      String orderTrackingMessage = form.getOrderTrackingMessage();
      if (!Format.isNullOrEmpty(orderTrackingMessage)) {
        AdminBean adminBean = getAdminBean(request);
        User user = adminBean.getUser();
        OrderTracking orderTracking = new OrderTracking();
        orderTracking.setOrderTrackingCode("");
        orderTracking.setOrderTrackingMessage(orderTrackingMessage);
        if (form.isOrderTrackingInternal()) {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_YES));
        }
        else {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_NO));
        }
        orderTracking.setRecUpdateBy(user.getUserId());
        orderTracking.setRecUpdateDatetime(new Date());
        orderTracking.setRecCreateBy(user.getUserId());
        orderTracking.setRecCreateDatetime(new Date());
        orderTracking.setOrderHeader(orderHeader);
        orderTracking.setCreditHeader(creditHeader);
        em.persist(orderTracking);
       
View Full Code Here

            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      CreditMaintActionForm form = (CreditMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    AdminBean adminBean = getAdminBean(request);
    User user = adminBean.getUser();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    CreditHeader creditHeader = (CreditHeader) em.find(CreditHeader.class, Format.getLong(form.getCreditHeaderId()));
    getMissingFormInformation(form, adminBean.getSiteId());
      OrderTrackingDisplayForm trackingForms[] = form.getOrderTrackings();
      for (int i = 0 ; i < trackingForms.length; i++) {
        OrderTracking orderTracking = (OrderTracking) em.find(OrderTracking.class, Format.getLong(trackingForms[i].getOrderTrackingId()));
        String value = String.valueOf(Constants.VALUE_NO);
        if (trackingForms[i].isOrderTrackingInternal()) {
          value = String.valueOf(Constants.VALUE_YES);
        }
        if (!orderTracking.getOrderTrackingInternal().equals(value)) {
          orderTracking.setOrderTrackingInternal(value);
            orderTracking.setRecUpdateBy(user.getUserId());
            orderTracking.setRecUpdateDatetime(new Date());
            em.persist(orderTracking);
        }
      }
     
View Full Code Here

  }
 
  private void saveLanguage(CustomAttribute customAttribute, CustomAttributeMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    CustomAttributeLanguage customAttribLanguage = null;
    User user = adminBean.getUser();
      Long siteProfileClassId = form.getSiteProfileClassId();
    boolean found = false;
    Iterator<?> iterator = customAttribute.getCustomAttributeLanguages().iterator();
    while (iterator.hasNext()) {
      customAttribLanguage = (CustomAttributeLanguage) iterator.next();
      if (customAttribLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
        found = true;
        break;
      }
    }
    if (!found) {
      customAttribLanguage = new CustomAttributeLanguage();
      customAttribLanguage.setRecCreateBy(user.getUserId());
      customAttribLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        customAttribLanguage.setSiteProfileClass(siteProfileClass);
        customAttribLanguage.setCustomAttribute(customAttribute);
        customAttribute.getCustomAttributeLanguages().add(customAttribLanguage);
    }
    if (form.isCustomAttribDescLangFlag()) {
      customAttribLanguage.setCustomAttribDesc(form.getCustomAttribDescLang());
    }
    else {
      customAttribLanguage.setCustomAttribDesc(null);
    }
    customAttribLanguage.setRecUpdateBy(user.getUserId());
    customAttribLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.persist(customAttribLanguage);
   
    for (int i = 0; i < form.getCustomAttribOptions().length; i++) {
      CustomAttributeOptionDisplayForm optionForm = form.getCustomAttribOptions()[i];
      CustomAttributeOption customAttributeOption = null;
      Long customAttribOptionId = Format.getLong(optionForm.getCustomAttribOptionId());
      customAttributeOption = CustomAttributeOptionDAO.load(adminBean.getSite().getSiteId(), customAttribOptionId);
      boolean exist = true;
      CustomAttributeOptionLanguage customAttributeOptionLanguage = null;
      for (CustomAttributeOptionLanguage optionLang : customAttributeOption.getCustomAttributeOptionLanguages()) {
        if (optionLang.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          customAttributeOptionLanguage = optionLang;
        }
      }
      if (customAttributeOptionLanguage == null) {
        customAttributeOptionLanguage = new CustomAttributeOptionLanguage();
        exist = false;
        customAttributeOptionLanguage.setRecCreateBy(user.getUserId());
        customAttributeOptionLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
          customAttributeOptionLanguage.setSiteProfileClass(siteProfileClass);
          customAttributeOptionLanguage.setCustomAttributeOption(customAttributeOption);
          customAttributeOption.getCustomAttributeOptionLanguages().add(customAttributeOptionLanguage);
      }
     
      if (form.isCustomAttribOptionLangFlag()) {
        customAttributeOptionLanguage.setCustomAttribValue(optionForm.getCustomAttribValueLang());
      }
      else {
        customAttributeOptionLanguage.setCustomAttribValue(null);
      }
      customAttributeOptionLanguage.setRecUpdateBy(user.getUserId());
      customAttributeOptionLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      if (!exist) {
        em.persist(customAttributeOptionLanguage);
      }
      optionForm.setCustomAttribValueLangFlag(form.isCustomAttribOptionLangFlag());
View Full Code Here

  }
 
  private void saveCurrency(CustomAttribute customAttribute, CustomAttributeMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteCurrencyClassId = form.getSiteCurrencyClassId();
    User user = adminBean.getUser();
    for (int i = 0; i < form.getCustomAttribOptions().length; i++) {
      CustomAttributeOptionDisplayForm optionForm = form.getCustomAttribOptions()[i];
      CustomAttributeOption customAttributeOption = null;
      Long customAttribOptionId = Format.getLong(optionForm.getCustomAttribOptionId());
      customAttributeOption = CustomAttributeOptionDAO.load(adminBean.getSite().getSiteId(), customAttribOptionId);       
      boolean exist = true;
      CustomAttributeOptionCurrency customAttributeOptionCurrency = null;
      for (CustomAttributeOptionCurrency optionCurr : customAttributeOption.getCustomAttributeOptionCurrencies()) {
        if (optionCurr.getSiteCurrencyClass().getSiteCurrencyClassId().equals(siteCurrencyClassId)) {
          customAttributeOptionCurrency = optionCurr;
        }
      }
      if (customAttributeOptionCurrency == null) {
        customAttributeOptionCurrency = new CustomAttributeOptionCurrency();
        exist = false;
        customAttributeOptionCurrency.setRecCreateBy(user.getUserId());
        customAttributeOptionCurrency.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          SiteCurrencyClass siteCurrencyClass = (SiteCurrencyClass) em.find(SiteCurrencyClass.class, siteCurrencyClassId);
          customAttributeOptionCurrency.setSiteCurrencyClass(siteCurrencyClass);
          customAttributeOptionCurrency.setCustomAttributeOption(customAttributeOption);
          customAttributeOption.getCustomAttributeOptionCurrencies().add(customAttributeOptionCurrency);
      }
     
      if (form.isCustomAttribOptionCurrFlag()) {
        customAttributeOptionCurrency.setCustomAttribValue(optionForm.getCustomAttribValueCurr());
      }
      else {
        customAttributeOptionCurrency.setCustomAttribValue(null);
      }
      customAttributeOptionCurrency.setRecUpdateBy(user.getUserId());
      customAttributeOptionCurrency.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      if (!exist) {
        em.persist(customAttributeOptionCurrency);
      }
      optionForm.setCustomAttribValueCurrFlag(form.isCustomAttribOptionCurrFlag());
View Full Code Here

        siteDomainLanguage = language;
        break;
      }
        }
        if (siteDomainLanguage == null) {
          User user = getAdminBean(request).getUser();
        siteDomainLanguage = new SiteDomainLanguage();
        SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
        SiteDomainParamBean siteDomainParamBean = new SiteDomainParamBean();
        siteDomainLanguage.setSiteDomainParam(Utility.joxMarshall("SiteDomainParamBean", siteDomainParamBean));
        siteDomainLanguage.setSiteProfileClass(siteProfileClass);
        siteDomain.getSiteDomainLanguages().add(siteDomainLanguage);
        siteDomainLanguage.setRecUpdateBy(user.getUserId());
        siteDomainLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
        siteDomainLanguage.setRecCreateBy(user.getUserId());
        siteDomainLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        em.persist(siteDomainLanguage);
        }
        copyProperties(form, siteDomain, getAdminBean(request));
        initListInfo(form);
View Full Code Here

                HttpServletResponse response)
    throws Throwable {

        SiteDomainMaintActionForm form = (SiteDomainMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
      Site site = SiteDAO.load(form.getSiteId());
    boolean insertMode = false;
    if (form.getMode().equals("C")) {
      insertMode = true;
    }
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
   
    InvoiceEngine invoiceEngine = new InvoiceEngine(orderHeader, user);
    invoiceEngine.invoiceAll();
View Full Code Here

TOP

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

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.