예제 #1
0
  @Override
  public void updateThing(String type) throws SQLException {
    if (type.equals("BannerCount")) {
      SqlMapClient ibatis = Mapper.getSqlMapper();
      ibatis.update("updateBannerCount", bid);
    }
    if (type.equals("BannerImage")) {
      try {
        uploadFile();
      } catch (IOException e) {
        e.printStackTrace();
      }

      bb = new BannerBean();

      bb.setBanner_num(bid);
      bb.setAdmin_num(Integer.parseInt(session.get("admin_num")));
      bb.setBanner_image_url(uploadFileName);

      SqlMapClient ibatis = Mapper.getSqlMapper();
      ibatis.update("updateBannerImage", bb);
    }

    if (type.equals("BannerInfo")) {
      bb.setAdmin_num(Integer.parseInt(session.get("admin_num")));
      SqlMapClient ibatis = Mapper.getSqlMapper();
      ibatis.update("updateBannerInfo", bb);
    }
  }
예제 #2
0
 @Override
 public void viewList(String type) throws SQLException {
   if (type.equals("Banner")) {
     SqlMapClient ibatis = Mapper.getSqlMapper();
     bannerList = ibatis.queryForList("selectBannerList");
   }
 }
예제 #3
0
  @Override
  public void insertThing(String type) throws SQLException {
    if (type.equals("Banner")) {
      try {
        uploadFile();
      } catch (IOException e) {
        e.printStackTrace();
      }

      bb.setAdmin_num(Integer.parseInt(session.get("admin_num")));
      bb.setBanner_image_url(uploadFileName);

      SqlMapClient ibatis = Mapper.getSqlMapper();
      ibatis.insert("insertBanner", bb);
    }
    if (type.equals("BannerLog")) {
      SqlMapClient ibatis = Mapper.getSqlMapper();
      ibatis.insert("insertBannerLog", blb);
    }
  }