/**
   * Saves the market configurations : deploy enterprise, username and password
   *
   * @param mkt
   */
  public static void saveMKTConfiguration(@Valid final MKT_Configuration mkt) {
    if (Validation.hasErrors()) {
      flash.error("Please fill in required fields");
      params.flash();
      Validation.keep();
      enable(mkt.getEnterprise_id(), mkt.getEnterprise_name());
    }

    Logger.info("------------------------- INSIDE SAVEMKT()-----------------");
    Logger.info(
        "Enterprise id :  "
            + mkt.getEnterprise_id()
            + " Enterprise Name  :  "
            + mkt.getEnterprise_name()
            + " Deploy username  :  "******" Deploy username  :  "******" Deploy Enterprise  :  "
            + mkt.getDeploy_enterprise_id());

    MKT_Configuration market = new MKT_Configuration();
    market.setEnterprise_id(mkt.getEnterprise_id());
    market.setEnterprise_name(mkt.getEnterprise_name());
    // market.setMkt_deploy_enterprise(mkt.getMkt_deploy_enterprise());
    market.setMkt_deploy_pw(mkt.getMkt_deploy_pw());
    market.setMkt_deploy_user(mkt.getMkt_deploy_user());
    market.setDeploy_enterprise_id(mkt.getDeploy_enterprise_id());
    market.save();
    marketEnable();

    Logger.info("------------------------- EXITING  SAVEMKT()-----------------");
  }
  /**
   * Saves the market configurations : deploy enterprise, username and password
   *
   * @param mkt
   */
  public static void enableMKTConfiguration(
      final Integer enterprise_id, final String enterprise_name) {
    if (Validation.hasErrors()) {
      flash.error("Please fill in required fields");
      params.flash();
      Validation.keep();
      enable(enterprise_id, enterprise_name);
    }

    Logger.info("------------------------- INSIDE SAVEMKT()-----------------");
    Logger.info("Enterprise id :  " + enterprise_id + " Enterprise Name  :  " + enterprise_name);

    String user = session.get("username");
    String password = session.get("password");

    MKT_Configuration market = new MKT_Configuration();
    market.setEnterprise_id(enterprise_id);
    market.setEnterprise_name(enterprise_name);
    // market.setMkt_deploy_enterprise(mkt.getMkt_deploy_enterprise());
    market.setMkt_deploy_pw(password);
    market.setMkt_deploy_user(user);
    market.setDeploy_enterprise_id(enterprise_id);
    market.save();
    marketEnable();

    Logger.info("------------------------- EXITING  SAVEMKT()-----------------");
  }