Beispiel #1
0
 public int getSequence() {
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     try {
       int seq = userMapper.getSequence();
       return seq;
     } catch (Exception e) {
       return -999;
     }
   }
   return -999;
 }
Beispiel #2
0
 public int getAllRownum() {
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     try {
       int num = userMapper.getAllRownum();
       return num;
     } catch (Exception e) {
       return -999;
     }
   }
   return -999;
 }
Beispiel #3
0
 public boolean deleteReq(int uidx) {
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     try {
       userMapper.deleteRequest(uidx);
       sqlSession.commit();
       return true;
     } catch (Exception e) {
       return false;
     }
   }
   return false;
 }
Beispiel #4
0
  public boolean createAccount(UserInfo userInfo) {

    UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
    if (userMapper != null) {
      try {
        userMapper.createAccount(userInfo);
        sqlSession.commit();
        return true;
      } catch (Exception e) {
        return false;
      }
    }
    return false;
  }
Beispiel #5
0
 /*
  * for Encrypt password
  */
 public boolean encryptPassword(UserInfo userInfo) {
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     try {
       userMapper.encryptSha512(userInfo);
       return true;
     } catch (Exception e) {
       e.toString();
       return false;
     }
   } else {
     return false;
   }
 }
Beispiel #6
0
 public boolean approveReq(int uidx) {
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     try {
       userMapper.approveRequest(uidx);
       userMapper.updateUpdate(uidx);
       userMapper.deleteRequest(uidx);
       return true;
     } catch (Exception e) {
       e.toString();
       return false;
     }
   } else {
     return false;
   }
 }
Beispiel #7
0
 public UserInfo2 getUser(int uidx) throws SQLException {
   UserInfo2 userInfo2;
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     userInfo2 = userMapper.getUser(uidx);
     if (userInfo2 == null) {
       userInfo2 = new UserInfo2();
       userInfo2.setErrorCode(Configuration.ErrorCodes.ER1001.getCodeName());
       userInfo2.setSubscribe_kor(Configuration.ErrorCodes.ER1001.getSubtitleKor());
       return userInfo2;
     } else {
       userInfo2.setErrorCode(Configuration.ErrorCodes.Success.getCodeName());
       userInfo2.setSubscribe_kor(Configuration.ErrorCodes.Success.getSubtitleKor());
       return userInfo2;
     }
   } else {
     userInfo2 = new UserInfo2();
     userInfo2.setErrorCode(Configuration.ErrorCodes.ER0000.getCodeName());
     userInfo2.setSubscribe_kor(Configuration.ErrorCodes.ER0000.getSubtitleKor());
     return userInfo2;
   }
 }
Beispiel #8
0
  public UserInfo login(LoginInfo loginInfo) throws SQLException {
    UserInfo userInfo;

    UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
    if (userMapper != null) {
      userInfo = userMapper.getData(loginInfo);
      if (userInfo == null) {
        userInfo = new UserInfo();
        userInfo.setErrorCode(Configuration.ErrorCodes.ER1001.getCodeName());
        userInfo.setSubscribe_kor(Configuration.ErrorCodes.ER1001.getSubtitleKor());
        return userInfo;
      } else {
        userInfo.setErrorCode(Configuration.ErrorCodes.Success.getCodeName());
        userInfo.setSubscribe_kor(Configuration.ErrorCodes.Success.getSubtitleKor());
        return userInfo;
      }
    } else {
      userInfo = new UserInfo();
      userInfo.setErrorCode(Configuration.ErrorCodes.ER0000.getCodeName());
      userInfo.setSubscribe_kor(Configuration.ErrorCodes.ER0000.getSubtitleKor());
      return userInfo;
    }
  }
Beispiel #9
0
 public UserList getRegList() throws SQLException {
   UserList userList;
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     List<UserInfo> reqList = userMapper.getRequest();
     if (reqList == null) {
       userList = new UserList();
       userList.setErrorCode(Configuration.ErrorCodes.ER1001.getCodeName());
       userList.setSubscribe_kor(Configuration.ErrorCodes.ER1001.getSubtitleKor());
       return userList;
     } else {
       userList = new UserList();
       userList.setReqList(reqList);
       userList.setErrorCode(Configuration.ErrorCodes.Success.getCodeName());
       userList.setSubscribe_kor(Configuration.ErrorCodes.Success.getSubtitleKor());
       return userList;
     }
   } else {
     userList = new UserList();
     userList.setErrorCode(Configuration.ErrorCodes.ER0000.getCodeName());
     userList.setSubscribe_kor(Configuration.ErrorCodes.ER0000.getSubtitleKor());
     return userList;
   }
 }
Beispiel #10
0
 public SectionList getSectionList() throws SQLException {
   SectionList sectionList;
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     List<Section> sList = userMapper.getSectionList();
     if (sList == null) {
       sectionList = new SectionList();
       sectionList.setErrorCode(Configuration.ErrorCodes.ER1001.getCodeName());
       sectionList.setSubscribe_kor(Configuration.ErrorCodes.ER1001.getSubtitleKor());
       return sectionList;
     } else {
       sectionList = new SectionList();
       sectionList.setSecList(sList);
       sectionList.setErrorCode(Configuration.ErrorCodes.Success.getCodeName());
       sectionList.setSubscribe_kor(Configuration.ErrorCodes.Success.getSubtitleKor());
       return sectionList;
     }
   } else {
     sectionList = new SectionList();
     sectionList.setErrorCode(Configuration.ErrorCodes.ER0000.getCodeName());
     sectionList.setSubscribe_kor(Configuration.ErrorCodes.ER0000.getSubtitleKor());
     return sectionList;
   }
 }
Beispiel #11
0
 public DepartmentList getDepartmentList() throws SQLException {
   DepartmentList depList;
   UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
   if (userMapper != null) {
     List<Department> dList = userMapper.getDepartmentList();
     if (dList == null) {
       depList = new DepartmentList();
       depList.setErrorCode(Configuration.ErrorCodes.ER1001.getCodeName());
       depList.setSubscribe_kor(Configuration.ErrorCodes.ER1001.getSubtitleKor());
       return depList;
     } else {
       depList = new DepartmentList();
       depList.setDepList(dList);
       depList.setErrorCode(Configuration.ErrorCodes.Success.getCodeName());
       depList.setSubscribe_kor(Configuration.ErrorCodes.Success.getSubtitleKor());
       return depList;
     }
   } else {
     depList = new DepartmentList();
     depList.setErrorCode(Configuration.ErrorCodes.ER0000.getCodeName());
     depList.setSubscribe_kor(Configuration.ErrorCodes.ER0000.getSubtitleKor());
     return depList;
   }
 }