public ActionForward execute(
      ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) {
    DistributeInventoryForm dform = (DistributeInventoryForm) form;

    req.setAttribute(
        WitribeConstants.LEAD_MANAGEMENT_ID, WitribeConstants.SALES_INVENTORY_MANAGEMENT);
    try {
      if (!validateSession(req, res)) {
        return mapping.findForward("login");
      }
      if (changeInvStatus(dform, req)) {
        req.setAttribute(WitribeConstants.HEADING, WitribeConstants.CHANGE_INVENTORY_STATUS);
        return mapping.findForward("success");
      }
    } catch (SQLException e) {
      LogUtil.error("Exception " + e.getMessage(), this.getClass());
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.HEADING_APP_FAIL);
      req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.APP_FAIL_MSG);
      return mapping.findForward(WitribeConstants.APP_FAIL_FWD);
    } catch (Exception e) {
      LogUtil.error("Exception " + e.getMessage(), this.getClass());
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.HEADING_APP_FAIL);
      req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.APP_FAIL_MSG);
      return mapping.findForward(WitribeConstants.APP_FAIL_FWD);
    }
    req.setAttribute(WitribeConstants.HEADING, WitribeConstants.FAIL_CHANGE_INVENTORY_STATUS);
    req.setAttribute(WitribeConstants.ERROR_STRING, WitribeConstants.CHANGE_STATUS_FAILED);
    return mapping.findForward("failure");
  }
  public ActionForward execute(
      ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) {
    // SalesPersonnelForm sform= (SalesPersonnelForm)form;
    ShopDetailsForm shopform = (ShopDetailsForm) form;
    String shopstatus = shopform.getShopStatus();

    try {

      if (!validateSession(req, res)) {
        return mapping.findForward("login");
      }
      if ("Active".equalsIgnoreCase(shopstatus)) {
        if (activateShop(shopform, req)) {
          req.setAttribute(WitribeConstants.HEADING, WitribeConstants.getCHANGE_SHOP_STATUS());
          return mapping.findForward("success");
        } else {
          req.setAttribute(WitribeConstants.HEADING, WitribeConstants.FAILED_ACTIVATE_SHOP);
          req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.MSG_FAILED_ACTIVATE_SHOP);
          return mapping.findForward("failure");
        }
      } else if ("Inactive".equalsIgnoreCase(shopstatus)) {
        if (inactivateShop(shopform, req)) {
          req.setAttribute(WitribeConstants.HEADING, WitribeConstants.getCHANGE_SHOP_STATUS());
          return mapping.findForward("success");
        } else {
          req.setAttribute(WitribeConstants.HEADING, WitribeConstants.FAILED_ACTIVATE_SHOP);
          req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.MSG_FAILED_INACTIVATE_SHOP);
          return mapping.findForward("failure");
        }
      }

    } catch (SQLException e) {
      LogUtil.error("Exception " + e.getMessage(), this.getClass());
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.HEADING_APP_FAIL);
      req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.APP_FAIL_MSG);
      return mapping.findForward(WitribeConstants.APP_FAIL_FWD);
    } catch (Exception e) {
      LogUtil.error("Exception " + e.getMessage(), this.getClass());
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.HEADING_APP_FAIL);
      req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.APP_FAIL_MSG);
      return mapping.findForward(WitribeConstants.APP_FAIL_FWD);
    }
    req.setAttribute(WitribeConstants.HEADING, WitribeConstants.getCHANGE_SHOP_STATUS());
    return mapping.findForward("success");
  }
示例#3
0
  public ActionForward execute(
      ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) {
    LeadEntryForm lform = (LeadEntryForm) form;
    req.setAttribute(WitribeConstants.LEAD_MANAGEMENT_ID, WitribeConstants.SALES_ORDER_MANAGEMENT);
    try {
      if (!validateSession(req, res)) {
        return mapping.findForward("login");
      }
      WitribeBO objBO = new WitribeBO();
      LeadVO objLeadVO = new LeadVO();
      objLeadVO.setLeadId(req.getParameter("leadId"));
      objLeadVO.setPlot(req.getParameter("plot"));
      objLeadVO.setStreet(req.getParameter("street"));
      objLeadVO.setSubzone("-");
      objLeadVO.setZone(req.getParameter("zone"));
      objLeadVO.setCity(req.getParameter("city"));
      objLeadVO.setProvince(req.getParameter("state"));
      objBO.updateLeadAddress(objLeadVO);
      // LeadVO objLeadVO = objBO.getLead(lform.getLeadId());
      objLeadVO = objBO.getLead(req.getParameter("leadId"));
      objLeadVO.setPlot(req.getParameter("plot"));
      objLeadVO.setStreet(req.getParameter("street"));
      objLeadVO.setSubzone("-");
      objLeadVO.setZone(req.getParameter("zone"));
      objLeadVO.setCity(req.getParameter("city"));
      objLeadVO.setProvince(req.getParameter("state"));
      objLeadVO.setReferredBy(req.getParameter("referredBy"));
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.VIEW_LEAD);
      req.setAttribute("objLead", objLeadVO);
      req.setAttribute(WitribeConstants.COVERAGE, req.getParameter("coverage_type"));
      req.setAttribute(WitribeConstants.SLA, req.getParameter("sla"));
      req.setAttribute(WitribeConstants.LONGITUDE, req.getParameter("longitude"));
      req.setAttribute(WitribeConstants.LATITUDE, req.getParameter("latitude"));

    } catch (Exception e) {
      LogUtil.error("Exception " + e.getMessage(), this.getClass());
      req.setAttribute(WitribeConstants.HEADING, WitribeConstants.HEADING_APP_FAIL);
      req.setAttribute(WitribeConstants.ERR_VAR, WitribeConstants.APP_FAIL_MSG);
      return mapping.findForward(WitribeConstants.APP_FAIL_FWD);
    }
    req.setAttribute(WitribeConstants.HEADING, WitribeConstants.ENTER_MORE_INFO);

    return mapping.findForward("success");
  }
示例#4
0
  public ActionForward execute(
      ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)
      throws Exception {
    LeadEntryForm lform = (LeadEntryForm) form;
    List objSouceList = new ArrayList();
    List objISPList = new ArrayList();
    List objReasonList = new ArrayList();
    String errorval = (String) req.getAttribute(WitribeConstants.ERROR_STRING);
    if ("yes".equalsIgnoreCase((String) req.getParameter("create")) && errorval == null) {
      try {
        List statusList = null;
        String cse = null;
        String salesId = "-1";
        LeadVO duplicateLeadVo = null;
        duplicateLeadVo = checkDuplicateLead(lform);
        if (duplicateLeadVo == null) {
          statusList = createLead(lform, cse, salesId);
        } else if (duplicateLeadVo.getSalesId() != null
            && duplicateLeadVo.getSalesId() != " "
            && !("-1".equalsIgnoreCase(duplicateLeadVo.getSalesId()))) {
          req.setAttribute(
              WitribeConstants.ERROR_STRING,
              "Lead ("
                  + duplicateLeadVo.getLeadId()
                  + ") has already been captured on  ("
                  + duplicateLeadVo.getCreateDate()
                  + ") by (created by "
                  + duplicateLeadVo.getSalesId()
                  + "-"
                  + duplicateLeadVo.getFullname()
                  + ").");
          return mapping.findForward("duplicate");
        } else if ("-1".equalsIgnoreCase(duplicateLeadVo.getSalesId())) {
          req.setAttribute(
              WitribeConstants.ERROR_STRING,
              "Lead ("
                  + duplicateLeadVo.getLeadId()
                  + ") has already been captured on  ("
                  + duplicateLeadVo.getCreateDate()
                  + ") by (created by "
                  + duplicateLeadVo.getSalesId()
                  + ").");
          return mapping.findForward("duplicate");
        } else {
          // req.setAttribute(WitribeConstants.ERROR_STRING,"Lead ("+duplicateLeadVo.getLeadId()+")
          // has already been captured on  ("+duplicateLeadVo.getCreateDate()+") by (created by
          // "+duplicateLeadVo.getSalesId()+"-"+duplicateLeadVo.getFullname()+").");
          req.setAttribute(
              WitribeConstants.ERROR_STRING,
              "Lead ("
                  + duplicateLeadVo.getLeadId()
                  + ") has already been captured on  ("
                  + duplicateLeadVo.getCreateDate()
                  + ").");
          return mapping.findForward("duplicate");
        }
        // statusList = createLead((LeadEntryForm)form,cse,salesId);
        return mapping.findForward("saved");

      } catch (Exception e) {
        LogUtil.error("Exception " + e.getMessage(), this.getClass());
        req.setAttribute(WitribeConstants.ERROR_STRING, WitribeConstants.APP_FAIL_MSG);
        return mapping.findForward("duplicate");
      }

    } else {
      HttpSession userSession = (HttpSession) req.getSession(true);
      WitribeBO leadbo = new WitribeBO();
      objReasonList = leadbo.getProspectReason();
      objSouceList = leadbo.getLeadSource();
      objISPList = leadbo.getISPList();
      req.setAttribute("LeadSourceList", objSouceList);
      req.setAttribute("LeadISPList", objISPList);
      req.setAttribute("objReasonList", objReasonList);
      userSession.setAttribute("online", 1);
      return mapping.findForward("success");
    }
  }