Package by.bsuir.hypermarket.dao.concrete

Examples of by.bsuir.hypermarket.dao.concrete.UserDao


 
  @Override
  public String execute(CommandParams<?> request) throws ServletException, IOException {
    try
      int userUid = Integer.parseInt(request.getParameter(Commands.INVERT_BAN_USER_UID));
      UserDao userDao = new UserDao();
      User userToBan = userDao.findEntityById(userUid);
      if (userToBan.getLogin() != null) {
        userToBan.setBan(!userToBan.isBan());
        userDao.updateEntity(userToBan);
        List<User> users = userDao.findAll();
        request.setAttribute(Commands.SHOW_USERS_LIST, users);
      }
    } catch (NumberFormatException e) {
      log.error("Can not parse user id", e);
    } catch (DaoException e) {
View Full Code Here


 
  @Override
  public String execute(CommandParams<?> request) throws ServletException,
      IOException {
    List<User> users = null;
    AbstractDao<User> usersDao = new UserDao();
    try {
      users = usersDao.findAll();
      request.setAttribute(Commands.SHOW_USERS_LIST, users);
    } catch (DaoException e) {
      log.error("Was not able to get users data", e);
    }
    String page = ConfigurationManager.INSTANCE.getProperty(ConfigurationManager.SHOW_USERS_PAGE_PATH);
View Full Code Here

  public String execute(CommandParams<?> request) throws ServletException, IOException {
    String page = null;
    String login = request.getParameter(Commands.LOGIN_LOGIN);
    String password = request.getParameter(Commands.LOGIN_PASSWORD);
    try
      UserDao userDao = new UserDao();
      User user = userDao.findUser(login, password);
      if (user.getLogin() != null) {
        if (!user.isBan()) {
          request.setSessionAttribute(Commands.LOGIN_USER, user);
          request.setSessionAttribute(Commands.CHANGE_LANG_LOCALE, Commands.CHANGE_LANG_ENGLISH);
          page = ConfigurationManager.INSTANCE.getProperty(ConfigurationManager.MAIN_PAGE_PATH);
View Full Code Here

TOP

Related Classes of by.bsuir.hypermarket.dao.concrete.UserDao

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.