コード例 #1
0
  /** 修改通知 */
  public boolean modifyNotic(Notic notic) throws ManagerException {

    boolean r = false;
    DBUtil db = new DBUtil();
    String sql =
        "update TD_SD_NOTIC set"
            + " topic='"
            + notic.getTopic()
            + "', content='"
            + notic.getContent()
            + "', begintime="
            + SQLManager.getInstance().getDBAdapter().getDateString(notic.getBeginTime())
            + ", endtime="
            + SQLManager.getInstance().getDBAdapter().getDateString(notic.getEndTime())
            + ", place='"
            + notic.getPlace()
            + "',  SOURCE="
            + notic.getSource()
            + " where schedular_id="
            + notic.getNoticID()
            + "";
    try {
      db.executeUpdate(sql);
      r = true;
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return r;
  }
コード例 #2
0
 /** 增加通知 */
 public boolean addNotic(Notic notic) throws ManagerException {
   boolean r = false;
   DBUtil db = new DBUtil();
   String sql =
       "intsert into TD_SD_NOTIC (notic_planner_id,EXECUTOR_ID,topic,place,begintime,endtime,content,status,source) "
           + "values ("
           + notic.getNoticPlannerID()
           + ","
           + notic.getExecutorID()
           + ",'"
           + notic.getTopic()
           + "',"
           + notic.getBeginTime()
           + ","
           + notic.getEndTime()
           + ",'"
           + notic.getContent()
           + "',"
           + notic.getStatus()
           + ",'"
           + notic.getSource()
           + "')";
   try {
     db.executeInsert(sql);
     r = true;
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return r;
 }