try { UserFilter filter = new UserFilter(); filter.setName(getName()); filter.setFirstName(getSurname()); if (DaoManager.getUserDao().getUsers(filter).size() > 0) return 4; } catch (Exception e) { return -1; }
if (operationType == TYPE_ADD) { try { UserFilter filter = new UserFilter(); filter.setName(getName()); filter.setFirstName(getSurname()); if (DaoManager.getUserDao().getUsers(filter).size() > 0) return 4; } catch (Exception e) { return -1; } }
	private int checking() {		String name = getName();		if (name == null || "".equals(name))			return 1;		String surname = getSurname();		if (surname == null || "".equals(surname))			return 2;		String email = getCourrielMail();		if (email != null && !"".equals(email) && !email.matches(".*@.*\\..*")) {			return 3;		}				try {		    UserFilter filter = new UserFilter();		    filter.setName(getName());		    filter.setFirstName(getSurname());		    if (DaoManager.getUserDao().getUsers(filter).size() > 0)                return 4;        } catch (Exception e) {            return -1;        }		return 0;	}