コード例 #1
0
  /** 修改广告来源信息 */
  public void modifyADSouce() {

    LEDAdSourceDB tLEDAdSourceDB = new LEDAdSourceDB();
    tLEDAdSourceDB.setProductCode(this.getProductCode());
    tLEDAdSourceDB.setSiteCode(this.getSiteCode());
    if (!tLEDAdSourceDB.getInfo()) {
      operateResult = "Fail|修改失败,数据库中没有此广告来源信息";
      return;
    }
    LEDAdSourceSchema tLEDAdSourceSchema = new LEDAdSourceSchema();
    tLEDAdSourceSchema.setSchema(tLEDAdSourceDB.getSchema());
    tLEDAdSourceSchema.setPayMode(this.getPayMode());
    tLEDAdSourceSchema.setContent(this.getContent());

    MMap map = new MMap();
    map.put(tLEDAdSourceSchema, "UPDATE");

    PubSubmit tPubSubmit = new PubSubmit();
    VData cVData = new VData();
    cVData.add(map);
    if (!tPubSubmit.submitData(cVData, "")) {
      operateResult = "Fail|修改操作失败";
      return;
    } else {
      operateResult = "Succ|修改成功";
      initData();
      return;
    }
  }
コード例 #2
0
  /** 保存数据 */
  public void save() {
    if (this.getSiteName() == null || "".equals(this.getSiteName())) {
      operateResult = "Fail|" + "网站名称不能为空!";
      return;
    }

    if (this.getSiteCode() == null || "".equals(this.getSiteCode())) {
      operateResult = "Fail|" + "网站缩写不能为空!";
      return;
    }

    if (this.getProductCode() == null || "".equals(this.getProductCode())) {
      operateResult = "Fail|" + "产品不能为空!";
      return;
    }

    if (this.getSiteType() == null || "".equals(this.getSiteType())) {
      operateResult = "Fail|" + "网站类型不能为空!";
      return;
    }
    if (this.payModelList == null || this.payModelList.length < 1) {
      operateResult = "Fail|" + "支付方式不能为空!";
      return;
    }

    String type = "";
    String sql =
        "select siteCode,siteType from ledadsource where siteCode='" + this.getSiteCode() + "'";
    ExeSQL tExeSQL = new ExeSQL();
    SSRS tSSRS = new SSRS();
    tSSRS = tExeSQL.execSQL(sql);
    int row = tSSRS.getMaxRow();
    if (row > 0) {
      type = tSSRS.GetText(1, 2);
      if (!this.getSiteType().equals(type)) {
        operateResult = "Fail|网站编码在数据库中已存在,输入的网站类型与存在的不一致!";
        return;
      }
    }

    sql =
        "select siteCode from ledadsource where "
            + "siteCode='"
            + this.getSiteCode()
            + "' "
            + "and productcode='"
            + this.getProductCode()
            + "'";
    tExeSQL = new ExeSQL();
    tSSRS = new SSRS();
    tSSRS = tExeSQL.execSQL(sql);
    row = tSSRS.getMaxRow();
    if (row > 0) {
      operateResult = "Fail|" + "添加失败!该数据在数据库中已存在!";
      return;
    }
    if ("all".equals(this.getProductCode())) {
      this.setVisitedPage("首页面");
    } else if ("register".equals(this.getProductCode())) {
      this.setVisitedPage("注册页面");
    } else if ("actIndex".equals(this.getProductCode())) {
      this.setVisitedPage("宣传页面");
    } else if ("readIndex".equals(this.getProductCode())) {
      this.setVisitedPage("阅读投保须知页面");
    } else {
      sql =
          "select contplanname from lepplan where contplancode='"
              + this.getProductCode()
              + "' and plantype='00'";
      this.setVisitedPage(tExeSQL.getOneValue(sql));
    }

    String siteUrl = "http://icare.metlife.com.cn/visit.jsf?source=";
    LisIDEA tLisIDEA = new LisIDEA();
    siteUrl = siteUrl + tLisIDEA.encryptString(this.getSiteCode());
    siteUrl = siteUrl + "&product=" + tLisIDEA.encryptString(this.getProductCode());
    LEDAdSourceSchema tLEDAdSourceSchema = new LEDAdSourceSchema();
    tLEDAdSourceSchema.setContent(this.getContent());
    tLEDAdSourceSchema.setProductCode(this.getProductCode());
    tLEDAdSourceSchema.setSiteCode(this.getSiteCode());
    tLEDAdSourceSchema.setSiteName(this.getSiteName());
    tLEDAdSourceSchema.setSiteType(this.getSiteType());
    tLEDAdSourceSchema.setUrl(siteUrl);
    tLEDAdSourceSchema.setPayMode(this.getPayMode());
    tLEDAdSourceSchema.setVisitedPage(this.getVisitedPage());
    MMap map = new MMap();
    map.put(tLEDAdSourceSchema, "INSERT");

    PubSubmit tPubSubmit = new PubSubmit();
    VData cVData = new VData();
    cVData.add(map);
    if (!tPubSubmit.submitData(cVData, "")) {
      operateResult = "Fail|添加失败";
      return;
    } else {
      operateResult = "Succ|添加成功";
      initData();
      find();
      return;
    }
  }