Package com.ordobill.webapp.beans

Examples of com.ordobill.webapp.beans.SystemImg


        return simFields;
    }
 
  @SuppressWarnings("unchecked")
    public String[] sendIconImgToFlex() throws Exception{
    ArrayList<SystemImg> imgList = (ArrayList<SystemImg>) sqlMap.queryForList("SystemImg.list", new SystemImg());
    String[] imgName = new String[imgList.size()];
    int _idx = 0;
    for(SystemImg img : imgList){
        imgName[_idx] = img.getSysimgFile();
        _idx++;
View Full Code Here


                bos.flush();
                bos.close();
                stream.close();

            // Insert DB
            SystemImg sysimgBean = new SystemImg();
            sysimgBean.setSysimgUid(sysimgUid);
            sysimgBean.setSysimgFile(filename);
            return (Integer) sqlMap.update("SystemImg.systemimgUpdateFile", sysimgBean);
        }

        return 0;
    }
View Full Code Here

                bos.flush();
                bos.close();
                stream.close();

            // Insert DB
            SystemImg sysimgBean = new SystemImg();
            sysimgBean.setSysimgUid(sysimgUid);
            sysimgBean.setSysimgFile(filename);
            return (Integer) sqlMap.update("SystemImg.systemimgUpdateFile", sysimgBean);
        }

        return 0;
    }
View Full Code Here

    public ActionForward list(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response) throws Exception {
       
      SystemImg sysimgForm = (SystemImg)form;       
        ArrayList<SystemImg> sysimgList = (ArrayList<SystemImg>) sqlMap.queryForList("SystemImg.list", sysimgForm);
        int totalCount = (Integer) sqlMap.queryForObject("SystemImg.listCount", sysimgForm);
       
        request.setAttribute("sysimgList", sysimgList);
        request.setAttribute("sysimgForm", sysimgForm);
View Full Code Here

    public ActionForward info(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response) throws Exception {
       
      SystemImg sysimgForm = (SystemImg)form;       
      SystemImg sysimgData = (SystemImg) sqlMap.queryForObject("SystemImg.list", sysimgForm);
       
        request.setAttribute("sysimgData", sysimgData);
        request.setAttribute("sysimgForm", sysimgForm);
       
        return mapping.findForward("info");
View Full Code Here

    public ActionForward update(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
       
        SystemImg sysimgForm = (SystemImg)form;
        log.debug("File Size is ===============>"+sysimgForm.getUpFile().getFileSize());
        if(sysimgForm.getUpFile().getFileSize() > 0){
         
          try{
            sqlMap.startTransaction();
            sqlMap.update("SystemImg.systemimgUpdate", sysimgForm);
            FormFile uploadFile = sysimgForm.getUpFile();
            FileManager.fileUpload(uploadFile, sysimgForm.getSysimgUid(), sysimgForm.getSysimgGubun());
           
            /**
             * 파일을 삭제합니다.
             */
            int isDelete = FileManager.fileDelete(sysimgForm.getSysimgFile());
           
            /**
             * 파일이 정상적으로 삭제되었다면 isDelete값은 0이상됩니다.
             */
            if(isDelete < 0){
              throw new Exception("기존 파일이 삭제 되지 않았습니다.");
            }
           
            sqlMap.commitTransaction();
           
            ActionMessages messages = new ActionMessages();
            messages.add("message", new ActionMessage("수정에 성공했습니다."));
            saveMessages(request, messages);           
          }catch(Exception e){
           
            log.error(e);
           
            ActionMessages errors = new ActionMessages();
            errors.add("message", new ActionMessage("수정에 실패했습니다."));
            saveMessages(request, errors);         
          }finally{
            sqlMap.endTransaction();
          }
         
        }
       
        if(sysimgForm.getUpFile().getFileSize() <= 0 || sysimgForm.getUpFile() == null){
          sqlMap.update("SystemImg.systemimgUpdate", sysimgForm);
        ActionMessages errors = new ActionMessages();
        errors.add("message", new ActionMessage("수정에 성공했습니다."));
        saveMessages(request, errors);
        }
        sysimgForm.setSysimgName("");
        SystemImg sysimgData = (SystemImg) sqlMap.queryForObject("SystemImg.list", sysimgForm);
        request.setAttribute("sysimgData", sysimgData);
        return mapping.findForward("update");
    }
View Full Code Here

   
    public ActionForward delete(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
      SystemImg sysimgForm = (SystemImg)form;
      int sysimgUid = (Integer) sqlMap.delete("SystemImg.systemimgDelete", sysimgForm);
     
      if(sysimgUid > 0){
        int isDelete = FileManager.fileDelete(sysimgForm.getSysimgFile());
       
        if(isDelete > 0){
          ActionMessages messages = new ActionMessages();
          messages.add("message", new ActionMessage("삭제 되었습했습니다."));
          saveMessages(request, messages);
View Full Code Here

    public ActionForward insert(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
       
      SystemImg sysimgForm = (SystemImg)form;
        try{
          sqlMap.startTransaction();
          int sysimgUid = (Integer) sqlMap.insert("SystemImg.systemimgInsert", sysimgForm);
          FormFile uploadFile = sysimgForm.getUpFile();
          FileManager.fileUpload(uploadFile, sysimgUid, sysimgForm.getSysimgGubun());
         
          sqlMap.commitTransaction();
         
      ActionMessages messages = new ActionMessages();
      messages.add("message", new ActionMessage("저장에 성공했습니다."));
View Full Code Here

TOP

Related Classes of com.ordobill.webapp.beans.SystemImg

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.