Package com.jada.admin.customerClass

Examples of com.jada.admin.customerClass.CustomerClassMaintActionForm


                             ActionForm actionForm,
                             HttpServletRequest httpServletRequest,
                             HttpServletResponse httpServletResponse)
        throws Throwable {

        CustomerClassMaintActionForm form = (CustomerClassMaintActionForm) actionForm;
        form.setMode("C");
        form.setSystemRecord("N");
      
        FormUtils.setFormDisplayMode(httpServletRequest, form, FormUtils.CREATE_MODE);
        ActionForward actionForward = actionMapping.findForward("success");
        return actionForward;
    }
View Full Code Here


                              HttpServletRequest request,
                              HttpServletResponse response)
        throws Throwable {

      Site site = getAdminBean(request).getSite();
        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");
        return actionForward;
    }
View Full Code Here

            HttpServletResponse response)
    throws Throwable {
   
      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

                HttpServletResponse response)
    throws Throwable {

      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    boolean insertMode = false;
    CustomerClassMaintActionForm form = (CustomerClassMaintActionForm) actionForm;
    if (form.getMode().equals("C")) {
      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

TOP

Related Classes of com.jada.admin.customerClass.CustomerClassMaintActionForm

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.