Ejemplo n.º 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;
    }
  }
Ejemplo n.º 2
0
 /**
  * 获取定量数据
  *
  * @return LEDAdSourceSet
  */
 public LEDAdSourceSet getData() {
   int tCount = 0;
   LEDAdSourceSet tLEDAdSourceSet = new LEDAdSourceSet();
   LEDAdSourceSchema tLEDAdSourceSchema = null;
   if (null == mResultSet) {
     CError tError = new CError();
     tError.moduleName = "LEDAdSourceDB";
     tError.functionName = "getData";
     tError.errorMessage = "数据集为空,请先准备数据集!";
     this.mErrors.addOneError(tError);
     return null;
   }
   try {
     tCount = 1;
     tLEDAdSourceSchema = new LEDAdSourceSchema();
     tLEDAdSourceSchema.setSchema(mResultSet, 1);
     tLEDAdSourceSet.add(tLEDAdSourceSchema);
     // 注意mResultSet.next()的作用
     while (tCount++ < SysConst.FETCHCOUNT) {
       if (mResultSet.next()) {
         tLEDAdSourceSchema = new LEDAdSourceSchema();
         tLEDAdSourceSchema.setSchema(mResultSet, 1);
         tLEDAdSourceSet.add(tLEDAdSourceSchema);
       }
     }
   } catch (Exception ex) {
     CError tError = new CError();
     tError.moduleName = "LEDAdSourceDB";
     tError.functionName = "getData";
     tError.errorMessage = ex.toString();
     this.mErrors.addOneError(tError);
     try {
       mResultSet.close();
       mResultSet = null;
     } catch (Exception ex2) {
     }
     try {
       mStatement.close();
       mStatement = null;
     } catch (Exception ex3) {
     }
     if (!mflag) {
       try {
         con.close();
       } catch (Exception et) {
       }
     }
     return null;
   }
   return tLEDAdSourceSet;
 }
Ejemplo n.º 3
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;
    }
  }
Ejemplo n.º 4
0
  public LEDAdSourceSet executeQuery(String sql, int nStart, int nCount) {
    Statement stmt = null;
    ResultSet rs = null;
    LEDAdSourceSet aLEDAdSourceSet = new LEDAdSourceSet();

    if (!mflag) {
      con = DBConnPool.getConnection();
    }

    try {
      stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

      rs = stmt.executeQuery(StrTool.GBKToUnicode(sql));
      int i = 0;
      while (rs.next()) {
        i++;

        if (i < nStart) {
          continue;
        }

        if (i >= nStart + nCount) {
          break;
        }

        LEDAdSourceSchema s1 = new LEDAdSourceSchema();
        if (!s1.setSchema(rs, i)) {
          // @@错误处理
          CError tError = new CError();
          tError.moduleName = "LEDAdSourceDB";
          tError.functionName = "executeQuery";
          tError.errorMessage = "sql语句有误,请查看表名及字段名信息!";
          this.mErrors.addOneError(tError);
        }
        aLEDAdSourceSet.add(s1);
      }
      try {
        rs.close();
      } catch (Exception ex) {
      }
      try {
        stmt.close();
      } catch (Exception ex1) {
      }
    } catch (Exception e) {
      // @@错误处理
      CError tError = new CError();
      tError.moduleName = "LEDAdSourceDB";
      tError.functionName = "executeQuery";
      tError.errorMessage = e.toString();
      this.mErrors.addOneError(tError);

      try {
        rs.close();
      } catch (Exception ex2) {
      }
      try {
        stmt.close();
      } catch (Exception ex3) {
      }

      if (!mflag) {
        try {
          con.close();
        } catch (Exception et) {
        }
      }
    }

    if (!mflag) {
      try {
        con.close();
      } catch (Exception e) {
      }
    }

    return aLEDAdSourceSet;
  }
Ejemplo n.º 5
0
  public LEDAdSourceSet query(int nStart, int nCount) {
    Statement stmt = null;
    ResultSet rs = null;
    LEDAdSourceSet aLEDAdSourceSet = new LEDAdSourceSet();

    if (!mflag) {
      con = DBConnPool.getConnection();
    }

    try {
      stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
      SQLString sqlObj = new SQLString("LEDAdSource");
      LEDAdSourceSchema aSchema = this.getSchema();
      sqlObj.setSQL(5, aSchema);
      String sql = sqlObj.getSQL();

      rs = stmt.executeQuery(sql);
      int i = 0;
      while (rs.next()) {
        i++;

        if (i < nStart) {
          continue;
        }

        if (i >= nStart + nCount) {
          break;
        }

        LEDAdSourceSchema s1 = new LEDAdSourceSchema();
        s1.setSchema(rs, i);
        aLEDAdSourceSet.add(s1);
      }
      try {
        rs.close();
      } catch (Exception ex) {
      }
      try {
        stmt.close();
      } catch (Exception ex1) {
      }
    } catch (Exception e) {
      // @@错误处理
      CError tError = new CError();
      tError.moduleName = "LEDAdSourceDB";
      tError.functionName = "query";
      tError.errorMessage = e.toString();
      this.mErrors.addOneError(tError);

      try {
        rs.close();
      } catch (Exception ex2) {
      }
      try {
        stmt.close();
      } catch (Exception ex3) {
      }

      if (!mflag) {
        try {
          con.close();
        } catch (Exception et) {
        }
      }
    }

    if (!mflag) {
      try {
        con.close();
      } catch (Exception e) {
      }
    }

    return aLEDAdSourceSet;
  }